198
198
198
0198
778
Abstract: In this paper, a control strategy for a quadrotor using neural network and differential flatness is proposed. Since attitude and altitude of the quadrotor are differential flat outputs for its flight dynamics, neural networks are used to perform the inversion of the flight dynamics and provide the nominal input control for the quadrotor. Errors in modeling approximations and perturbations are fed back into an additional closed loop control structure in order to assure tracking accuracy. Numerical simulations are displayed for analysis. Key-words: Artificial Neural Flatness, Non-linear Control. 1. INTRODUCTION In the last years studies in unmanned aerial vehicles, in special rotor powered systems, have been developed since they appear to present simultaneously hovering, orientation and trajectory tracking capabilities at reasonable cost [1], [2], [3], [4], [5]. These flying devices have been introduced in many civilian and military applications and new configurations and control laws must be developed to assure their applicability to new missions. The flight mechanics of the quadrotor are highly nonlinear and different control approaches (sliding mode control, backstepping control, non-linear inverse control) have been considered with success to achieve trajectory tracking. However, the effective practical realisation of these control solutions depends on the availability of accurate measurement systems dedicated to the estimation of the angular rates, attitude and heading angles as well as the inertial position and speed components of the quadrotor. To overcome these specific difficulties and obtain a practical control system, this paper proposes the use of a neural network control structure based on differential flatness. Differential flatness [6] has provided new opportunities to design advanced control schemes for non-linear systems as a quadrotor and some applications of this technique in the field of aerospace have been performed [7], [8], [9]. Here, the differential flatness property of quadrotor attitude and altitude dynamics is displayed and a feed-forward backpropagation neural network is used to invert the flight Network, Differential
dynamics and calculate the nominal input to the system according to the desired output in order to track heading and altitude trajectories. Tracking errors, originated in modelling approximations and perturbations, are fed back into an additional closed loop control structure to assure tracking accuracy and to eliminate drift phenomena. In the remainder, the adopted formulation of the flight dynamics model of the quadrotor is first presented, followed by a brief description about the differential flatness approach applied to the quadrotor. A control structure employing neural network is presented and numerical simulations are displayed, showing effective results for the proposed control solution. 2. FLIGHT DYNAMICS MODELLING The quadrotor, shown in figure (1), has four propellers in cross configuration where two pairs of propellers turn in opposite directions. By varying the rotor speeds, one can change the lift forces and create motion. Thus, increasing or decreasing evenly the four propellers speeds together generates vertical motion. F1 F4
1
F2 Y {E} Z X
z y
{B}
4
x
F3
mg
Changing evenly the 2 and 4 propellers speed conversely produces roll rotation coupled with lateral motion. Pitch rotation and the corresponding lateral motion result
779
A Neural Network Control Based on Differential Flatness for a Quadrotor S. S. Cunha Jr, B. Panomruttanarug, H. Al-Fazari, F. Mora-Camino
from 1 and 3 propellers speed conversely modified. Yaw rotation is more subtle, as it results from the difference in the counter-torque between each pair of propellers. To limit the complexity of the modeling, the following assumptions are adopted [1]: The quadrotor structure is rigid and symmetrical; No wind; Negligible aerodynamic contributions; No ground effect as well as negligible air density effects and very small rotor response times.
which can be expressed analytically as a function of the current state, the current input and its derivatives, while the state and the input vectors can be expressed analytically as a function of Z and a finite number of its derivatives. Then there exists smooth mapping Gx , GU , and Gz are:
It is then possible to write simplified rotorcraft flight equations [2]. The moment equations can be written as:
& = (1 / I xx ) [l (F4 F2 ) + k 2 qr ] p
where n z and n x are integer numbers. Vector Z is called a flat output for the nonlinear system given by equation (12). Although until today there is no systematical way to determine flat outputs and eventually to prove its uniqueness, the flat outputs usually possess some physical meanings. The explicit flatness property is of particular interest for the solution of control problems when physically meaningful flat outputs can be related with their objectives. The motion equations of the rotorcraft can be written in non-linear state form as:
& = f (x, u ) x
where:
& = p + tan ( ) [sin ( ) q + cos( ) r ] & = cos( ) q + sin ( ) r & = (sin ( ) q + cos( )r ) / cos( )
u p = F4 F2 u q = F1 F3
where , , and are respectively the pitch, bank and heading angles. The acceleration of the centre of gravity, taken directly in the local Earth reference frame, is such as:
u = F2 F1 + F4 F3 u z = F1 + F2 + F3 + F4
& & = (1 / m )[cos( ) sin ( ) cos( ) + sin ( ) sin ( ) F dx] (7) x & & = (1 / m )[sin ( )sin ( )cos( ) cos( )sin ( ) F dy ] (8) y & & = g (1 / m ) [cos( ) cos( ) F + dz ] z
(9)
Considering here the output vector Z = ( , , , z ) the inversion of the Euler equations (4), (5) and (6) provides expressions such as:
where x , y and z are the centre of gravity coordinates, m is the total mass of the quadrotor, dx , dy and dz are the drag forces and:
&, & p = p ,
&, & q = q , ,
F = F1 + F2 + F3 + F4
with the constraints:
(10)
( ) &, &) r = r ( , ,
& sin ( ) & p =
0 Fi Fmax
i {1,2,3,4 }
& + sin ( )cos ( ) & q = cos ( ) & + cos ( )cos ( ) & r = sin ( )
while u can be expressed as:
& = (X ,U ) X
X n , U m
(12)
where is a smooth mapping, is said explicitly flat with respect to the output vector Z , if Z is an m th order vector
(29)
780
additional control
& k 2 qr ) l u p = (I xx p & k 4 pr l uq = I yy q
PD control
gains
Then, it can be concluded that the attitude and heading dynamics as well as the altitude of the rotorcraft are differentially flat when considering the input-output relation between u and Z . 4. A NEURAL NETWORK CONTROL STRATEGY According to section 3, given a desired output (attitude, heading and altitude) of the quadrotor:
Zd
& Z d & & Z
d
ANN
nominal control
SYSTEM
Zr
5. RESULTS Numerical simulations using MATLAB/Simulink have been performed for generating training and validation data for the neural network as well as for the control purposes. Physical parameters of the quadrotor have been adopted in the simulations and the main characteristics of this system are reported in [2]. Here, the chosen control objective is relative to tracking heading and altitude while the attitude of quadrotor remains unchanged ( = 0 and = 0 ). Then, two feed-forward back-propagation neural networks with only one hidden layer have been constructed to perform the inversion of the quadrotor flight dynamics, one for altitude control inversion (u z ) and then other one for heading u .
Z d = (d , d , d , z d )
(34)
the inputs of the system, equation 18, are solutions of the set of equations 30-33 and a causal relationship between the inputs and flat outputs of the system is verified. Since neural networks are well fitted to reproduce causal relations [8], we can use these devices to map the desired output with the flat inputs of the system. Then, a neural network is developed to perform an inversion of the flight dynamics of the quadrotor where the inputs of the neural network are the desired attitude, heading and altitude (equation 34) and its time derivates and where its outputs are the nominal flight control parameters as shown in figure (2). The reason to introduce a neural network control structure based on differential flatness for the quadrotor is to eliminate the need of measurements dedicated to the estimation of various flight variables (angular rates, attitude and heading angles, inertial position and speed) as needed in other non-linear control techniques. Here, the proposed approach requires only to know the desired trajectory and its time derivates, enabling practical applications. However, a control structure using the neural network inversion is open loop and errors originated in modeling approximations, in perturbations and in the training of the neural network should generate drift behavior or worse instability. To fix this problem, an additional closed loop is added to the control structure and the errors are fed back into a PD control unit to insure tracking accuracy and to eliminate drift phenomena. Figure (2) shows the proposed closed loop control structure.
( )
A set of desired heading ( d ) and altitude ( z d ) trajectories have been created to perform the training and validation of neural networks. Figure (3) shows an example of training performance for the two neural sub-networks.
781
A Neural Network Control Based on Differential Flatness for a Quadrotor S. S. Cunha Jr, B. Panomruttanarug, H. Al-Fazari, F. Mora-Camino Tab. 1. Characteristics of the neural networks
- NN
n of neurons (hidden layer) mean square error activation function Training epochs 20 1.01x10-6 hyperbolic tangent 240.000
z - NN
20 4.90x10-6 hyperbolic tangent 240.000
The effectiveness of the proposed control structure has been evaluated by numerical simulations. Further study will focus in a full state control of the quadrotor engaged in complex 3D/4D trajectory tracking.
REFERENCES
[1]PUB A. Drouin, A.B. Ramos, F. Mora-Camino, Rotorcraft Trajectory Tracking by Non Linear Inverse Control, Proceedings of the 6th DINCON, So Jos do Rio Preto, Brazil, 2007. [2]PUB A. Drouin, T. Miquel, F. Mora-Camino, NonLinear Control Structures for Rotorcraft positioning, AIAA Guidance, Navigation and Control Conference, Honolulu, 2008. [3]DOI M. Bouchoucha, M. Tadjine, A. Tayebi, P. Mllhaupt, Step by Step Robust Nonlinear PI for Attitude Stabilization of Four-Rotor Miniaircraft, Proceedings of the 16th Mediterranean Conference on Control and Automation, Ajaccio, France, 2008. [4]DOI Y. Bouktir, M. Haddad, T. Chettibi, Trajectory Planning for a Quadrotor Helicopter, Proceedings of the 16th Mediterranean Conference on Control and Automation, Ajaccio, France, 2008.
Figure (4) shows tracking results for heading and altitude for an open loop. The results appear to be quite satisfactory for the first instants but drift phenomena is observed and the proposed control structure must be considered to fix it.
Fig. 4. Desired and effective heading angle and altitude in open loop
Then, figure (5) shows the tracking results when an additional PD control structure is placed in parallel with the neural networks. The drift phenomena is eliminated and the quadrotor tracks with high accuracy the desired trajectory. The gains of PD control have been empirically chosen as:
[5]DOI C. Nicol, C.J.B. Macnab, A. Ramirez-Serrano, Robust Neural Network Control of a Quadrotor Helicopter, IEEE, 2008. [6] M. Fliess, J. Lvine, P. Martin, and P. Rouchon, Flatness and Defect of Non-Linear Systems: Theory and Examples, Int. J. Control, Vol. 61, No. 6, pp. 13271361, 1995. [7] L. Lavigne, F. Cazaurang, and B. Bergeon, Modelling of Longitudinal Disturbed Aircraft Model by Flatness Approach, AIAA Guidance, Navigation and Control Conference and Exhibit, USA, 2003. [8]DOI W.C. Lu, R.M. Faye, A.C.B. Ramos, J. Slama, F. Mora-Camino, Neural Inversion of Flight Guidance Dynamics, 7th International Conference on Intelligent Systems Design and Applications, RJ, Brazil, 2007. [9]PUB W.C. Lu, F. Mora-Camino, K. Achaibou, Flight Mechanics and Differential Flatness, DINCON 04, Proceedings of Dynamics and Control Conference, Ilha Solteira, Brazil, 2004.
[G ] =
1 .0 0 .5 0 .5 1 .0
(35)
6. CONCLUSION
In this paper, a neural network control system based on differential flatness applied to a quadrotor has been developed. The differential flatness property of quadrotor was displayed and neural networks were used to invert the flight dynamics and calculate the nominal input to the system in order to track heading and altitude trajectories. Tracking errors, originated in modelling approximations, perturbations and neural networks training were fixed using an additional PD control system.