You are on page 1of 6

Grey-box modelling of an Unmanned Quadcopter

during Aggressive Maneuvers

Paulin Kantue Jimoh Olarewaju Pedro


Research and Development Group School of Mechanical, Industrial and
Uav4africa (Pty) Ltd Aeronautical Engineering
Johannesburg, South Africa University of the Witwatersrand
kantuep@uav4africa.co.za Johannesburg, South Africa
Jimoh.Pedro@wits.ac.za

Abstract—The treatment of quadcopter dynamics around using energy-based control which would not have been
steady-state conditions has often ignored some rotorcraft aero- possible otherwise.
dynamic effects due to its complicated physical modeling or
black-box estimated model. The identification of an unmanned
Given that a physical model, also known as white-box
quadcopter in accelerated flight using a grey-box modeling
approach is investigated. The classical approach of using either model, of transitional flight aerodynamics can be quite in-
first-principles modeling (white-box modeling) or pure obser- volved, a black-box approach has been used specifically to
vations modeling (black-box modeling) have limitations partic- identify the quadcopter dynamics [7]. Radial basis functions
ularly for real-time applications. Radial basis functions neural (RBF) were trained with a minimal resource allocating net-
networks (RBF-NN) were used to estimate the rotor dynamics work (MRAN) algorithm within a nonlinear Auto Regressive
parameters (motor PWM outputs) from an unknown flapping eXogenous inputs (ARX) model structure. More recently,
dynamics model. The identified models shows that a RBF- a fuzzy clustering model structure has also been used to
based grey-box modeling approach specifically in aggressive identify quadcopter dynamics in hover using fuzzy linguistic
maneuvers, has benefits in both modeling accuracy, network ’If-else’ rules [8]. However a black-box approach often does
size and robustness to noise.
not have a good representation of the underlying dynamics
Keywords—Grey-box modeling, Model identification, Un- and is only valid in the region under which the system was
manned Systems, quadcopter, neural networks tested [9].

I. I NTRODUCTION Grey-box modelling is a well established discipline


whereby the dynamic behaviour is described based on the
Although quadcopters are a popular aerial vehicle in physical model and the parameters in that model structure
terms of mechanical simplicity and low maintenance (com- are estimated with input-output measurements [10]. The
pared to single-rotor helicopters), the modelling and identifi- main difference with the black-box approach is that grey-
cation efforts have mainly been near steady-state conditions box models use a-priori knowledge of the system dynamics
such as hover and forward flight [1]. Given the increased and estimate the unknown free parameters through system
operation of quadcopters in confined spaces and between identification techniques. Such an approach has been used
buildings, the expansion of their aerodynamic model, espe- to estimate quadcopter motor dynamics and propeller aero-
cially in transient flight, is required. This would eventually dynamic coefficients [11], estimating the longitudinal/lateral
lead to the development of high-fidelity control systems coefficients of small-scale fixed-wing UAV [12] and the
which is necessary for the successful integration of unmanned estimation of a quadcopter heave and rotational aerodynamic
quadcopters in an urban environment. coefficients using closed-loop identification techniques [13].
The linearisation of quadcopter dynamics around hover The latter research linearised the physical model and used
or slow forward flight was used to develop linear-time- the linear model for its model structure.
invariant (LTI) models [2]. This has been the primary focus
for various control system synthesis and applications such as: In this paper, a grey-box modelling approach for the
PID [3] and sliding mode control [4]. However, in transitional estimation of rotor dynamics of a H-frame mini quadcopter in
flight, it has been shown that compensation against blade aggressive maneuvers is investigated. In section 2 the math-
flapping dynamics can only be achieved through accurate ematical model of a Pixhawk-based unmanned quadcopter
modelling instead of further flight controller tuning (in this with the inclusion of rotor dynamics are presented. Section
case increasing the integral gain) [5]. This oversight on the 3 describes the nonlinear identification framework which
aerodynamics could prevent accurate and robust tracking makes use of the RBF neural networks for grey-box mod-
which is the primary requirement in autonomous high-speed elling and estimation. The experimental design for closed-
manoeuvres or acrobatic flight. The problem of singularities loop system identification is proposed in Section 4. Section
during a quadcopter vertical loop maneuver was investigated 5 discusses the results obtained followed by conclusions and
[6]. Underactuation during such a maneuver was resolved future work.
II. M ATHEMATICAL M ODEL
The equations of motion of a quadcopter (shown in Figure
1) can be expressed with respect to the body-fixed reference
frame:
mv̇ + m(ω × v) = F (1)
Iω̇ + (ω × Iω) = M (2)

where v = [u v w]T and ω = [p q r]T are the


vehicle velocities and angular rates in the body-fixed frame,
respectively. And F = [X Y Z]T is the vector of external
forces on the vehicle center of gravity and M = [L M N ]T
is the vector of external moments. I = [Ixx Iyy Izz ] are the
mass moment of inertia measured using a bifilar pendulum
method. The angular orientation of the aircraft is described
by Euler angles. The generalized thrust force of an individual Fig. 1. Quadcopter Rotor forces and moments
rotor is given as:
Ti = CTi ρ(Ωi Ri )2 πRr2 (3) velocities u, v, w can be computed from the inertial NED
i = 1 − 4 represents the number of the rotors (four in velocities (available given a GPS module) and the rotation
this case). CT is the rotor thrust coefficient which can be transformation matrix attitute angles comprised of φ, θ, ψ.
expressed as: The rotor torque for the ith rotor Qi can be computed:
Qi = CQ ρ(Ωi Rr )2 πRr3 (12)
1 µ2
   
ar σr µzri − λ0i
C Ti = θ0 + + (4)
2 3 2 2 where the torque coefficient is given:
 
where ar is the lift slope of the propeller, cr is the root chord CD0 σr 7
CQi = CTi (λ0i − µz ) + 1 + µ2ri (13)
of the rotor blade (assuming constant chord), Rr is the rotor 8 3
blade length, θ0 is the pitch angle of the propeller (assuming
no blade twist). The inflow velocities at the ith rotor can be This was done by lumping each rotor and its flapping
expressed: dynamics into tip-path plane dynamics described below (ex-
cluding feathering hinge dynamics) [14], [15]:
CT
λ0i = p (5) b1i 1 δb1i v − vwind
2ηw µ2r + (λ0i − µzri )2 ˙
b1i = −p − − (14)
τe τe δµv Ωi Rr
a1i
= −q −
p
(u − uwind )2 + (v − vwind )2 a˙1i
µri =
Ωi R r
(6) τe 
1 δa1i u − uwind δa1i w − wwind
− + (15)
w − wwind τe δµ Ωi R r δµz Ωi R r
µzri = (7) τe is the effective rotor time constant for the rotor. The
Ωi Rr
longitudinal dihedral derivative is given as:
2cr δa1i

4θ0

σr = (8) = 2Kµ − λ0i (16)
πRr δµ 3
whereby the inflow velocity λ0i is solved through an iterative Kµ is the scaling coefficient to include the stabilizing effect.
approach. In the case of transitional flight, λ0i will typically The longitudinal and lateral dihedral derivatives are equal in
not have a steady-state value. magnitude and both cause the rotor to flap away from the
At each ith rotor, the velocity components can be com- incoming air.
puted from body-fixed velocities u, v, w and angular rates δb1i δa1i
p, q, r: =− (17)
δµv δµ
ui = u + Sui Lf r r sin θf r (9) The upward heave movement of the rotor causes a higher lift
vi = v + Svi Lf r r cos θf r (10) on the advancing blade which causes a moment on the rotor
wi = w + Rxi q + Ryi p (11) hub. The same stabilizer scaling coefficient is used:
δa1i 16µ2
= Kµ (18)
where Lf r is the length for airframe COG to ith rotor δµz (1 − µ2 /2)(8 |µ| + ar σr )
hub, S̄u = [Su1 , ..., Su4 ], similarly R¯x and R¯y are arrays of
cross-product signs due to angular rates. θf r is the angular Rotor flapping is the dominant effect on rotor moments.
distance of each rotor to the airframe y axis. The body-fixed The restraint is approximated using a linear torsional spring
respect to network approximations of f and g. Equation 27
can be expressed in the compact form:
ẋ = fˆ(x, θf∗ ) + ĝ(x, θg∗ )u + ν(t) (28)
where θf∗ and θg∗ denote the optimal weights values in the
approximations of f (x) and g(x) respectively such that
h i
θf∗ := argθf min f (x) − fˆ(x, θf ) (29)
θg∗ := argθg min [g(x) − ĝ(x, θg )] (30)
Fig. 2. Rotor flapping approximation [16]
and ν(t) is the modelling error defined as:
h i 
ν(t) = f (x(t)) − fˆ(x, θf∗ ) + g(x(t)) − ĝ(x, θg∗ )

with constant stiffness coefficient Kβ . This is illustrated in (31)
Figure 2. This results in a longitudinal (pitch) and lateral
(roll) moment: A. Neural Network Architecture
Mk,lon = Kβ a1i (19) The radial basis function (RBF) network is described as
Lk,lat = Kβ b1i (20) a two-layer processing structure whereby the hidden layer
consists of an array of nodes. Each node contains a parameter
function called a center. The node computes a nonlinear
Once flapping occurs, the rotor thrust vector tilts and transformation of the neuron Euclidean distance. This is the
contributes to the body moments. Assuming the thrust vector distance between the neuron center and network input vector.
tilts proportionally to the rotor flapping angles, the total rotor The RBF network implements the mapping fˆr : Rn → R
pitch and roll moments can be deduced as (N = 4 for a according to
quadcopter):
nh
X
N
P fˆr (x) = η + ηij φ (kx − cj k , ρj ) , 1≤i≤m (32)
Lr = (Kβ + T hr ) b1i (21) j=1
i=1
N
P where x ∈ Rn is the input vector, φ(·) is the given function
Mr = (Kβ + T hr ) a1i (22) from the Rn to R, k·k denotes the Euclidean norm, η, 0 ≤
i=1
N
i ≤ nh , are the weights or parameters, cj ∈ Rn , 0 ≤ i ≤ nh ,
are the RBF centers and nh are the number of centers. ρj
P
Nr = Qi (23)
i=1 is the centers width. For this study the Gaussian nonlinear
function is used for the RBF centers which is described as:
where hr is the distance between the rotor head and the center
of gravity. The total rotor forces (not assuming small advance φ(z, ρ) = exp(−z 2 /ρ2 ) (33)
ratios) are given as:
where ρ is a real constant. To ensure stability during network
learning and low convergence time, the orthogonal least
N
squares (OLS) method was used [17]. RBF learning was also
achieved using a moving window algorithm which generated
P
Xr = − Ti sin(a1i ) (24)
i=1 an input-output data set at each time step.
N
P
Yr = Ti sin(b1i ) (25) B. Problem formulation
i=1
N
P In transitional flight during an aggressive maneuver, the
Zr = − Ti (26) rotor dynamics are not well characterized for adequate flight
i=1
control performance. The intention is to estimate the rotor
forces given the measurements of body angular rates, body
III. N ONLINEAR I DENTIFICATION
velocities and individual motor PWM (pulse width modula-
The identification of nonlinear systems of the form tion) values sent to the ESCs. The input-output mapping is
given as follows:
ẋ = f (x) + g(x)u (27)

where u ∈ < is the input, x ∈ <n is the state (obtained


h i
utsi = uti , vit , wit , pt , q t , rt , δTt , δφt , δθt , δrt (34)
from measurements). The identification problem consists of
choosing the appropriate identification model such that the yit = [P W Mit ] (35)
unknown nonlinearities of f (x) and g(x) are parametrized by
the static neural network with outputs fˆ(x, θf ) and ĝ(x, θg ) where P W Mi is the input to the motor ESC (electronic
respectively, where θf ∈ Rnf , θg ∈ Rng are the adjustable speed controller). ui , vi , wi are the computed body-fixed
weights and nf , ng denote the number of weights with velocities transalated the ith rotor location, δTt , δφt , δθt , δrt are
the joystick PWM positions controlling thrust, roll angle, powered by a 4-cell lipo battery with 11x4.5 inch propellers
pitch angle and yaw rate set points. The PWM value can and BEC (battery eliminated circuit) ESCs. The mass proper-
be related to both a rotor thrust and torque from a database ties (obtained using a bifilar pendulum method) are given in
specific to the motor/propeller/battery configuration. Table I. A Pixhawk (version 2.4.8) flight controller has been
integrated for autonomous missions and including aggressive
C. Validation Criteria maneuvering commands. The quadcopter is calibrated and
configured using the Mission Planner software prior to every
The validation step satisfies the condition of the prediction flight.
model structure being a subset of the true system dynamics. A
common method is to simulate the predicted output ŷ from
measured inputs and compare it with the measured output
y(t). The model fit is given as:

 
kν(t)k
Pf = 1− (36)
ky(t) − ȳk


ky(t) − ȳk
Pi = 1 −
(37)
kν(t)k

where k.k is the L2 norm and ȳ is the mean of the value


y(t). To ensure valid model fit, the data used to validate
must be different from the data used during the estimation.
This process is known as cross-validation [18, p. 501]. The
Pf value of above 0.5 with the low number of neurons (less Fig. 3. Denel Dynamics H1 quadcopter
than a third of the sample size) ensures that a good estimated
model has been achieved. An inverse of this function given TABLE I. H1 QUADCOPTER MASS PROPERTIES
as Pi which results in number close to 0, can also be used
to verify the estimated model is free from overfitting. The Parameter Min Mean Max
Mass (kg) - 1.75 kg -
fraction of these two numbers, falling in the range of 1.0 Ixx (kg.m2 ) 0.03259 0.03274 0.03298
and 3.0, confirms the cross-validation process. Iyy (kg.m2 ) 0.04117 0.04202 0.04295
Izz (kg.m2 ) 0.07270 0.07327 0.07467

D. Experimental Design
Given the unstable open-loop behaviour of a quadcopter, A. Data Collection
the identification of the rotor dynamics can only be achieved
with the flight controller in the loop called closed-loop In order to achieve unsteady aerodynamic conditions in
identification. Based on [18], closed-loop identification can the quadcopter, the flight manoeuvres were performed such
only be achieved if (1) the data is informative; (2) the that the adequate excitation could be achieved. The data was
identified model contains the true system. The issue of collected at 10Hz. Figure 4 shows the RC (radio control)
information content in the data set can be resolved in various inputs to achieve a downward sharp turn to achieve high
ways. (1) Consider an input-output model structure which roll and pitch angles of over 35 deg with non-zero IMU
is not directly manipulated by the feedback path [18, p. (inertial measurement unit) angular rates up to 4 deg/s shown
431]. (2) Consider the persistent excitation of the input in Figure 5. This confirmed that the stabilizing controller had
signals provided the model structure contains the true system not settled, enabling the excitation of the rotor dynamics.
dynamics [18, p. 435].
This unsteady condition is confirmed by the navigation
The direct identification method is a popular approach inertial velocities (shown in Figure 6) showing a large change
in closed-loop identification since it uses the input vector, in downward velocity. This can be translated into body fixed
u, the output vector, y and ignores the reference signal r, velocities at a ith rotor location as described in Equation 34.
causing the approach to be indifferent to the complexity of This is shown in Figure 7.
the controller (in this case the flight controller) [18, p. 440].
B. RBF Training
IV. R ESULTS
The spread constant was chosen as the mean of the
The chosen platform for this research is custom-built H- Euclidean input space vector so that the neuron activation
frame quadcopter from Uav4africa named simply H1 (Shown function output gives 0.72 at the mean value. This was chosen
in Figure 3). The H-frame configuration is preferred over analyzing the noise levels of the output channel. This should
the more popular X-frame mainly due to the larger area for always be checked prior to training the RBF model. The
extra electronics, camera gimbal or additional payload. It is Euclidean goal for stopping the learning was chosen based
30
m1_vx
m1_vy
1800 m1_vz
20

Rotor-1 Velocities [m/s2 ]


1700
T 10
r
PWM inputs [ sec]

1600
0

1500
-10

1400
-20

1300
-30
174 176 178 180 182 184 186 188 190 192 194

1200
Time [s]
174 176 178 180 182 184 186 188 190 192 194
Time [s]
Fig. 7. Body-fixed velocities at Rotor #1 location

Fig. 4. RC Transmitter
on the variance of the de-trended output. A sample size of
181 was used for both training and validating. Table II shows
that adequate training with minimal amount of neurons was
5
achieved.
Roll rate
4 Pitch rate TABLE II. RBF LEARNING RESULTS
Yaw rate
Param EUc g EUc a NR Pf Pi /Pf
3
Motor-1 2.639 2.623 8 0.59 2.46
Motor-2 3.308 3.305 9 0.69 3.21
2
IMU Gyro [deg/s]

Motor-3 3.513 3.511 4 0.46 1.84


Motor-4 3.478 3.452 3 0.36 1.57
1

0
where EUc g and EUc a are the Euclidean training goal
-1
and achieved error at the stop of the learning routine respec-
-2 tively. N R is the number of neurons in the hidden layer.
-3
The combination of the low Pf and Pi values show there’s a
good correlation between the RBF network predicted output
-4
174 176 178 180 182 184 186 188 190 192 194
compared to validated dataset. Figure 8 shows how the choice
Time [s] of training goal effects the network prediction accuracy. This
means an effective optimization method is required to ensure
Fig. 5. IMU rates the correct train goal is chosen.
2500 50

2000 40
15
RBF Prediction [Pi /P f ]

RBF No. Neurons


10
1500 30

5
Inertial velocities [m/s]

1000 20
0

-5
500 10
-10

-15 0 0
0.5 1 1.5 2 2.5 3 3.5
-20 RBF Network goal [EUc_g]
VN
VE
-25 Fig. 8. RBF prediction sensitivity to training goal and model size
VD
-30
174 176 178 180 182 184 186 188 190 192 194
Time [s] C. Rotor Estimates
Fig. 6. Inertial velocities Figures 9 and 10 show that the estimated model match
with training data and validation data respectively. This can
be noticed that eventhough the the RBF neural network
models have rejected most of the measurement noise from the selection algorithm should be used to prevent collinearity of
input/output data during the training process. The validation inputs. Other neural network training methods/architectures
set shows a good model fit which can then be used with could be investigated with specific focus on the estimation
methods such as the modified delta method to compute aero- of unsteady quadcopter rotor dynamics.
dynamic heave dynamics coefficients at each rotor such as
Zw which is a performance measure for propeller efficiency R EFERENCES
[15].
[1] I. M. Salameh, E. M. Ammar, and T. A. Tutunji, “Identification of
The grey-model approach can now be adopted to estimate quadcopter hovering using experimental data,” 2015 IEEE Jordan
Conference on Applied Electrical Engineering and Computing Tech-
the angular speed Ω at each rotor given the estimated torque nologies, AEECT 2015, pp. 3–8, 2015.
Ti and thrust coefficient CTi is based on the computed inflow [2] X. Zhang, X. Li, K. Wang, and Y. Lu, “A survey of modelling and
velocities dynamics as described in Equation 5. identification of quadrotor robot,” Abstract and Applied Analysis, vol.
2014, 2014.
RBF Training - output comparison
1800 [3] J. Li and Y. Li, “Dynamic analysis and PID control for a quadrotor,” in
Mechatronics and Automation (ICMA), 2011 International Conference
1750
on. IEEE, 2011, pp. 573–578.
1700 [4] K. Runcharoon and V. Srichatrapimuk, “Sliding Mode Control of
1650 Quadrotor,” in International Conference on Technological Advances in
Motor PWM #2 [ s]

Electrical, Electronics and Computer Engineering (TAEECE), 2013,


1600 pp. 552–557.
1550 [5] H. Huang, G. Hoffmann, S. Waslander, and C. Tomlin, “Aerodyam-
ics and Control of Automous Quadrotor Helicopters in Aggressive
1500
Maneuvering,” in IEEE International Conference on Robotics and
1450 Automation, 2009, pp. 3277–3282.
1400 [6] A. A. El-Badawy and M. A. Bakr, “Quadcopter Aggressive Ma-
neuvers along Singular Configurations: An Energy-Quaternion Based
1350 NN_training Out Approach,” Journal of Control Science and Engineering, vol. 4, 2016.
Training Out
1300 [7] M. F. Pairan and S. S. Shamsudin, “System identification of an
0 20 40 60 80 100 120 140 160 180 200
unmanned quadcopter system using MRAN neural,” IOP Conference
No. of Samples
Series: Materials Science and Engineering, vol. 270, pp. 1–10, 2017.
Fig. 9. RBF training performance - rotor 2 PWM outputs [8] M. M. Ferdaus, S. G. Anavatti, M. A. Garratt, and M. Pratama,
“Fuzzy clustering based nonlinear system identification and controller
development of Pixhawk based quadcopter,” 2017 Ninth International
1800 Conference on Advanced Computational Intelligence (ICACI), pp.
1750
223–230, 2017.
[9] M. B. Tischler, C. M. Ivler, and T. Berger, “Comment on ”Method
1700
for Real-Time Frequency Response and Uncertainty Estimation”,”
1650 Journal of Guidance, Control, and Dynamics, vol. 38, no. 3, pp.
Motor PWM #2 [ s]

547–549, 2015.
1600
[10] R. Romijn, L. Özkan, S. Weiland, J. Ludlage, and W. Marquardt, “A
1550 grey-box modeling approach for the reduction of nonlinear systems,”
Journal of Process Control, vol. 18, no. 9, pp. 906–914, 2008.
1500
[11] Q. Li, “Grey-Box System Identification of a Quadrotor Unmanned
1450 Aerial Vehicle,” Ph.D. dissertation, Delft University of Technology,
1400 2014.
[12] J. Ahsan, M. Ahsan, A. Jamil, and A. Ali, “Grey Box Modeling of
1350 NN_predict Out
validate Out Lateral-Directional Dynamics of a UAV through System Identifica-
1300 tion,” Proceedings - 14th International Conference on Frontiers of
0 20 40 60 80 100 120 140 160 180 200
Information Technology, FIT 2016, pp. 324–329, 2017.
No. of Samples
[13] Marcus Back, “Grey-box Modelling of a Quadrotor Using Closed-
Fig. 10. RBF prediction performance - rotor 2 PWM outputs loop Data,” Linkopings University, 2015.
[14] V. Gavrilets, “Autonomous Aerobatic Maneuvering of Miniature He-
licopters,” Ph.D. dissertation, Massachusetts Institute of Technology,
2003.
V. C ONCLUSION
[15] J. O. Pedro and P. Kantue, “Online aerodynamic parameter estimation
The identification of an unmanned quadcopter rotor dy- of a miniature unmanned helicopter using radial basis function neural
networks,” in ASCC 2011 - 8th Asian Control Conference, 2011, pp.
namics in an aggressive manoeuvre based on a grey-box 1170–1175.
modeling approach has been presented here. Radial basis
[16] G. M. Hoffmann, H. Huang, S. L. Waslander, and C. J. Tomlin,
functions neural networks (RBF-NN) were used to estimate “Precision Flight Control for A Multi-Vehicle Quadrotor Helicopter
the rotor dynamics parameters (motor PWM outputs) from Testbed,” Control engineering practice, vol. 19, no. 9, pp. 1023–1036,
an unknown flapping dynamics model, with a good model 2011.
fit and robustness to measurement noise. Better choice of the [17] S. Chen, C. F. N. Cowan, and P. M. Grant, “Orthogonal least squares
Euclidean goal based on the input/output variance and an learning algorithm for radial basis function networks,” pp. 302–309,
1991.
optimisation process which takes into account the model fit
percentage should be investigated. Moreover, a RBF model [18] L. Ljung, System Identification Theory for User. Prentice Hall, 1999.

You might also like