Position Controlling of A Flapper Drone Using UWB
Position Controlling of A Flapper Drone Using UWB
Position Controlling of A Flapper Drone Using UWB
Publication date
2021
Document Version
Final published version
Published in
Proceedings of the 12th International Micro Air Vehicle Conference
Citation (APA)
Gonzalez Archundia, G., de Croon, G. C. H. E., Olejnik, D. A., & Karasek, M. (2021). Position controller for
a flapping wing drone using uwb. In J. Martinez-Carranza (Ed.), Proceedings of the 12th International Micro
Air Vehicle Conference (pp. 85-92). [IMAV2021-10]
Important note
To cite this publication, please use the final published version (if applicable).
Please check the document version above.
Copyright
Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent
of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.
Takedown policy
Please contact us and provide details if you believe this document breaches copyrights.
We will remove access to the work immediately and investigate your claim.
sation of ground effects in flapping-wing flight door environments to complement IPS. Usually INS systems
is obtained from hovering experiments. The employ micro-electro mechanical systems (MEMS) or iner-
proposed controller improves position control tial measurement units (IMU). Furthermore, data fusion is
by a factor ∼ 1.5, reaching a mean absolute also applied for better accuracy, by means of a Kalman fil-
error of 10cm for position in x and y, and 4.9cm ter. Hence many combinations of integrated systems have
for position in z. been proposed. For example a GPS/UWB/MEMS navigation
system with Kalman filter [6] and INS/UWB system based
on a fuzzy adaptive Kalman filter [7]. Although most of
1 I NTRODUCTION these implementations provide a basis for designing an au-
The fact that drones are becoming increasingly popular tonomous position controller, it is important to keep in mind
is intimately related with the development of more sophis- they are specifically designed either for fixed-wing or quadro-
ticated automation resources. In the case of drones, weight, tor UAVs. In the case of flapping wing drones some extra
processing speed, and energy consumption are critical aspects constraints shall be considered like the physical limitations in
to accomplish fully autonomous flights. Therefore, elements terms of payload and energy consumption, or the noise influ-
such as motors, micro-processors, memory units and batteries ence in IMU measurements due to high frequency mechanical
need to be continuously improved to meet these requirements. vibration [8]. To overcome these circumstances, the existing
These conditions have fostered the development of flapping solutions must be adapted, leaving a potential research devel-
wing micro-air vehicles (FWMAV). This type of UAV is in- opment for position controllers of FWMAVs.
spired on the flight of birds and insects, and has become at- One of the challenges of working with FWMAVs comes
tractive in the field of small-scale micro-air vehicles, since it from the aerodynamics of the system. A reliable model of
provides both the ability of hovering and flying into any di- the dynamics can significantly increase the performance and
rection. After the foundational work from Ellington [1] and accuracy. Nevertheless, most aerodynamic models for flap-
Dickinson [2], many experiments have been carried out in or- ping wings require extensive system identification techniques
der to get an optimal physical design of FWMAVs, as well as for numerous parameters, whose values only remain valid
velocity and position controllers to keep a stable flight. for a specific drone. A widespread alternative is the use of
Regarding position feedback, the most common option is quasi-steady models where force coefficients are obtained ei-
an indoor positioning system (IPS). Some of the technolo- ther from experimental data or from theoretical principles [9].
gies used for for IPS are Wi-fi, Radio Frequency Identifica- The control strategy proposed in this paper follows a sim-
tion (RFID), and infrared (IR) motion tracking systems. Wi-fi pler solution where the model is obtained by directly aver-
and RFID can be found for tracking mobile devices, but not aging aerodynamic parameters as functions in terms of the
specifically for drones [3]. IR is used for indoor tracking of body velocities. Albeit the method may be considered just
a rough approximation compared to quasi-steady models, it
* Email address(es): g.gonzalezarchundia@student.tudelft.nl,
g.c.h.e.decroon@tudelft.nl,
tends to be more practical since just a reduced amount of pa-
d.a.olejnik@tudelft.nl, rameters is required. When validating averaging parameters
matej@flapper-drones.com with real flight data, several authors address the issues of un-
This paper addresses the three aforementioned challenges topilot and the ground station is done with a Crazyradio PA
of FWMAVs. Sections 2, 3 and 4 provide the background (also from Bitcraze), which is a USB radio dongle based on
for the implementation. Section 5 describes how averaging nRF24LU1+ from Nordic Semiconductor. The system can be
parameters are applied for drag compensation. Section 6 powered with a 300-mAh two-cell 7.4V LiPo battery, reach-
discusses the issues of changing voltage and ground effects. ing a flight time between 4-6 minutes, depending on the in-
Lastly, Section 7 shows the results on how the transient re- ternal resistance of the battery.
sponse is improved in any of the three axes: forward (x-axis),
sideways (y-axis) and vertical (z-axis).
2 E XPERIMENTAL SETUP
Since the work on this project relies mainly on feed-
back through UWB, the experimental setting should be a grid
where UWB receivers are strategically located in the vertices
and the transceiver is mounted on the FWMAV. This way, the Figure 2: Flapper drone equipped with IR markers and UWB
drone flies inside the volume of a cube bounded by the posi- sensor
tion of the anchors. A similar set-up is used in [16], where the
eight anchors on the corners optimise the possibility for the
drone to have line-of-sight at least with one anchor. Such a 3 C ONTROL LOOP
grid was set-up at the Cyberzoo (shown in Figure 1), the flight For autonomous flight, the flapping-wing drone uses a
arena of the TU Delft Faculty of Aerospace, which is known cascaded PID-controller, based on the structure presented by
as the main facility of the university for performing tests on [20]. The controller consists of three loops. The output pro-
drones, and has a size of 10m × 10m × 7m. A reliable choice vides the control signals for the motors involved in the flight
for UWB sensor is the Decawave DWM1000, as it has proven dynamics of the drone: two brush-less motors in charge of
to give successful results for UAV tracking [17]. The UWB the flapping frequency for thrust and roll, one servo-motor
sensors are used as the anchors of the IPS and are set to work that modifies the angle of the dihedral for pitch, and another
using a time difference of arrival (TDOA) algorithm. servo-motor that changes the deflection of the wings for yaw.
In order to have a reference for the UWB measurements, a Regarding the structure of the cascaded loops, the inner-
motion tracking system is used for measurements of position most loop is in charge of attitude rate and runs at 500Hz. The
and rotations. It consists of 12 OptiTrack Prime 17W mo- intermediate loop also runs at 500Hz and is in charge of atti-
tion tracking cameras (set to resolution 1664 px × 1088 px, tude control. The outer loop is the position/velocity control,
50 fps) and has proven to deliver accurate results for MAV which runs at 100Hz and can take either position or velocity
test flights [18]. When working with the motion tracking sys- commands.
tem, the drone was equipped with four retro-reflective mark- Another remark is the trimming values for servos in
ers placed on the landing gear of the drone, and the UWB charge of pitch, roll and yaw. This procedure must be done
sensor was placed at the top to optimise direct line of sight in order to get the proper behaviour from the controller. For
measured attitude and the current attitude. The purpose for Once the variable sensor noise term was implemented
using attitude errors instead of the conventional Euler angles into the EKF, several flight paths were tested (linear, square,
is to simplify the state prediction equations because it only rhombus and hexagonal paths). The measurements from
considers the increments in roll, pitch and yaw. A more de- UWB using a TDOA algorithm proved to be reliable enough
tailed explanation on the implementation of the filter is given for position estimation. The mean absolute error obtained in
in [21]. all cases remained between 8-10 cm, when compared to the
The main advantage of fusing UWB with IMU through measurements from the Optitrack system.
the Kalman filter is the attitude correction to account for the
drift in pitch and roll caused by sensor noise and bias. For in- 5 D RAG COMPENSATION
stance, when the Flapper is left standing up, the Kalman filter
The first technique for yielding a better control strategy
resets correctly the roll and pitch to zero when UWB mea-
for FWMAVs was to obtain a model for drag compensation.
surement are coming in. On the other side, a complementary
Since the drag is typically neglected in aerodynamic models,
filter, which relies only on IMU data, will converge to a cer-
there tends to be an offset between the commanded veloc-
tain drift and thus propagates it through time.
ity and the velocity output by the controller. Usually a feed
One last adjustment done to the EKF aims to diminish the
forward term is used to compensate for these drag effects.
detrimental effects on position estimation caused by multi-
Following the structure of the controller in Section 3, the ve-
path UWB signals. Specially when going close to the ground,
locity loops provides the input for the attitude loop. Thus,
the position estimates tend to drift for more than 20 cm.
feed forward is modelled as a function of velocity:
A way to account for the wrong measurements when flying
close to the ground is to use a variable sensor noise value
θF F = f (vxE ) (3)
Ruwb for measurements from UWB, rather than a constant
value. Consequently, the sensor noise is defined as:
ϕF F = f (vyE ) (4)
2
Ruwb = λ(ẑ)σuwb (2)
Where Eq. (3) is the feed forward term for pitch and Eq. (4)
Where λ(ẑ) is a factor dependent on the estimated height ẑ, is for roll. In order to derive such a model, a system identi-
in meters. For the implementation, λ = 0.5, for z ≥ 1; fication experiment is proposed based on the supplementary
λ = 1.5 − ẑ, for 0.5 < ẑ < 1; and λ = 1, for z ≤ 0.5. materials from [22], where step inputs in roll and pitch are
The effect of variable sensor noise in position estimation was given to the flapping-wing drone and then the transient re-
tested by placing the drone static on the ground, at the origin sponse is recorded. The experiments are done using manual
(0,0,0) of the UWB IPS. The plots from Figure 3 show the flight via a Frsky RC-controller where the pitch and roll step
estimated position (est) in contrast to the real position (cmd), inputs are pre-programmed. The tracking data is recorded
Both values were sampled at 50Hz, during 8 seconds. Using with the motion tracking system mentioned in Section 2.
the variable sensor noise Ruwb significantly increases the ac- Figure 4 is given as an example of the transient response
curacy in estimation approximately by 0.2m in the three axes. in velocity obtained for different step-inputs in pitch (a sim-
ilar response is obtained for roll angles). Due to limitations
4
Velocity
As expected, results from Table 1 show on the angles of
Pitch = 12°
Pitch = 22°
Pitch = 33°
accurate ground truth (12º,22º and 33º) that the overall accu-
3
Pitch = 45°
Pitch = 52° racy of the extrapolation model, for both pitch and roll, in-
V xE [m/s]
2 creases as more data points are taken for the regression. Indi-
vidually, for each angle, accuracy remains approximately the
same with 50% of the data points or more. For illustration
1
the behaviour of a first-order system. Hence, the equation for proximated as the exponential function in Eq. (6). Linear or
the transient response is modelled as an exponential function quadratic models could be used as well, but they would only
of the form: be valid within specific ranges since they do not converge to
v(t) = a − be−ct+d (5) a constant value.
The parameters a, b, c and d from Eq. (5) have to be initialised v(θ) = a + be−cθ (6)
with certain values, depending on the shape of the curve ob-
tained from the measured data points. The final steady-state Using the obtained steady-state velocity, a nonlinear re-
values obtained from the extrapolation model strongly de- gression model is obtained using Eq. (6). For both pitch and
pend on how many data points are considered for the regres- roll the parameters are initialised as: a = −90, b = 90 and
sion model. Hence, Table 1 shows the absolute error between c = 0.3. Moreover, to test the applicability of the exponential
the last measured velocity for each angle, and the respective model, the same described procedure was applied to the data
value calculated from the extrapolation model. For the angles sets from [22] regarding the Delfly Nimble (a 33cm-wingspan
of 30° or less, this velocity approximates to the steady-state FWMAV of the same type). Then the nonlinear regression
velocity. For angles of 45° or above, the last measured veloc- model is applied initialising the parameters with exactly the
ity is used as ground truth equilibrium velocity, although it is same values. Figure 6 shows how the exponential curves of
still part of the transient response. the Flapper and the Delfly properly approximate to the given
data points for both roll and pitch.
Final velocity error at different pitch angles [m/s]
Data taken for regression 12° 22° 33° 45°* 52°*
10% 0.124 0.0752 0.1842 0.2641 0.276
6 H EIGHT CONTROL
30% 0.0318 0.0459 0.0347 0.1899 0.1259 Having a reliable height control strategy is essential to
50% 0.0166 0.0636 0.015 0.2048 0.0038
70% 0.0183 0.0632 0.0282 0.1379 0.0402
guarantee successful autonomous flight. Mainly it is used
90% 0.0142 0.0561 0.0289 0.0857 0.0185 to keep the drone flying at a certain altitude and for hov-
Final velocity error at different roll angles [m/s] ering. Nevertheless, it also plays a major role in landing,
Data taken for regression 12° 22° 33° 47°* 52°* which is known to be as the most challenging phase of flight
10% 0.1007 0.1479 0.0391 0.2972 0.3028
30% 0.10 0.1216 0.0452 0.2303 0.2366
for any aircraft. Height control is intimately related with
50% 0.0262 0.1427 0.0325 0.0499 0.0849 thrust. Therefore, two approaches for improving thrust com-
70% 0.0234 0.0802 0.0378 0.0486 0.095 mand were considered, first one is a voltage-dependent thrust
90% 0.0268 0.0247 0.0261 0.0266 0.0757 model, and second one is an analysis of the ground effects.
Table 1: Extrapolation errors taking different amounts of data 6.1 Voltage-thrust model
for regression model. *Indicates that for those angles the final Thrust is part of the position and velocity control of the
velocity is not considered as ground truth. Hence these errors drone, it also involves a PID controller which takes a com-
are overestimated. manded throttle and delivers an output signal for the motors.
The signal from the controller is summed with a feed forward
5.5
4
Data
5 Data for regression
Data
3.5 Regression model
Data for regression
Regression model 4.5
3
4
2.5 3.5
Velocity [m/s]
Velocity [m/s]
2 3
2.5
1.5
2
1
1.5
0.5
1
0 0.5
0 2 4 6 8 10 0 1 2 3 4 5 6 7 8 9
Time [s] Time [s]
Figure 5: Extrapolation models for pitch (left) and roll (right) at different velocities
Pitch-velocity Roll-velocity
10 10
Setpoints Flapper Setpoints Flapper
0 =0° Setpoints Delfly =0° Setpoints Delfly
=0° 0 =0°
Exponential Flapper Exponential Flapper
Exponential Delfly Exponential Delfly
-10 -10 =10°
=12°
=12°
Pitch [deg]
-40 -40
http://www.imavs.org/
=42°
=45°
=45°
-50 =45° -50
=52°
=52°
=57°
-60 =57° -60
-70 -70
-80 -80
-90 -90
0 5 10 15 0 5 10 15
Velocity [m/s] Velocity [m/s]
Figure 6: Pitch/velocity (left) and roll/velocity(right) models obtained from extrapolated data
term known as base thrust, which is the thrust required to trollers: a P and PI height controller, using both the constant
keep the drone hovering at a certain altitude. In most cases and variable base thrust. For each controller, the flight was
the base thrust is a constant value, but there is evidence that analysed in five different directions: X-motion, Y-motion, Z-
the required base thrust tends to increase as the battery volt- motion, XZ-motion and YZ-motion. For each motion, a flight
age drops off [13]. In order to observe this behaviour, a series test was done consisting on five repetitions of step-input com-
of experiments were done where the drone started flying with mands in the given motion, in order to get an average be-
a fully-charged battery and then let it hover until the battery haviour. Hence, Table 2 summarises the standard deviation
got discharged. all values were sampled at 50 Hz and mapped and the mean absolute error between the transient response
as depicted in Figure 7. and the commanded height for each motion and controller.
Throttle is used instead of thrust because this is the signal Notice from the table that for most of the motions, using a PI
that is directly input into the motors. In this case, throttle is a will result in lower error than a P controller, regardless of the
dimensionless value where 30000 sets the motors to the low-
est speed and 60000 indicates full speed. The data points are
then filtered and used to create a regression model. The im-
provement when increasing the order of the regression model
is not significant. First, second and third-order models yield
R2 ≈ 0.756. Albeit there is noisy data involved, it is not
considered for the regression model since it is already known
that the noise comes mainly from the feedback of the con-
troller and the IMU measurements. Nevertheless, there is the
option of using alternative regression models to account for
the stochastic behaviour observed in Figure 7, which may re-
sult in a better R2 value.
Once the model is implemented, the base thrust turns into
a variable base thrust whose value will tend to increase the
longer the drone keeps flying. To evaluate the model, a series Figure 7: Throttle and voltage mapping with tendency lines
of experiments was conducted using four different thrust con- for different regression models
variable or constant base thrust. For most conditions, vari- between thrust ratio and height can be modelled as:
able PI reaches the lowest mean absolute error and standard 2
deviation, showing the utility of varying thrust model. Tinput 1
=1−λ (7)
Toutput h−a
Figure 8 depicts the averaged transient response in height
for each controller, for the cases of X motion and XZ mo- After mapping the thrust ratio with their respective height,
tion. The reduction of steady-state error caused by the inte- a non-linear regression model using equation Eq. (7) is ap-
gral gain is clear in the X motion, where the drone should plied. Such model approximates the coefficients λ = 0.00093
keep flying at the same height when moving from one posi- and a = 0.4213. In Figure 9, the regression model stays
tion to another. The XZ motion shows a case in which vari- within the bounds of each data point. At the tested heights the
able thrust model performs less well. In motions where a ground effect still has relatively little influence on the thrust
change in height occur, performance is more similar between ratio. The thrust ratio only decreases to 92% at the lowest
P and PI controllers. From one side the integral gain tends to height of 0.33m. Thus, the ground effect is little up to 0.33m.
increase the settling time compared to the P controller, but at Lower heights are not considered relevant, because, due to
the same time the oscillations of the PI response reduces the the disposition the UWB anchors, the drone is unlikely to fly
error to minimum whenever it crosses the commanded value. lower except during take-off and landing. Nevertheless, the fit
shows a sharp drop-off below 0.33m. Whether this is correct
will have to be confirmed with future experiments.
http://www.imavs.org/
0.8
Thrust ratio [-]
0.6
0.4
Figure 8: Extrapolation models for pitch (left) and roll (right) 0.2
Data points
0
0.2 0.4 0.6 0.8 1 1.2
Distance to touch ground [m]
Table 2: Errors and standard deviations for each controller. Best result for each condition is bold-cased.
Table 3: Mean absolute errors of validation experiments. Best (a) Absolute error in Velocity X
http://www.imavs.org/
ments. IEEE Communications Letters, 10(4):275–277, 2006. [18] Matěj Karásek, Mustafa Percin, Torbjørn Cunis, Bas W
[6] Zengke Li, Guobin Chang, Jingxiang Gao, Jian Wang, and van Oudheusden, Christophe De Wagter, Bart DW Remes,
Alberto Hernandez. GPS/UWB/MEMS-IMU tightly coupled and Guido CHE de Croon. Accurate position control of a
navigation with improved robust kalman filter. Advances in flapping-wing robot enabling free-flight flow visualisation in
Space Research, 58(11):2424–2434, 2016. a wind tunnel. International Journal of Micro Air Vehicles,
11:1756829319833683, 2019.
[7] Qigao Fan, Yaheng Wu, Jing Hui, Lei Wu, Zhenzhong Yu,
and Lijuan Zhou. Integrated navigation fusion strategy of [19] Matej Karasek. Flapper drones. https://flapper-
INS/UWB for indoor carrier attitude angle and position syn- drones.com/wp/. Accessed: 2021-01-01.
chronous tracking. The Scientific World Journal, 2014, 2014. [20] Controllers in the crazyflie.
[8] Karl Martin Kajak, Matej Karásek, Qi Ping Chu, and GCHE https://www.bitcraze.io/documentation/repository/crazyflie-
De Croon. A minimal longitudinal dynamic model of a tail- firmware/2020.04/functional-areas/controllers/.
less flapping wing robot for control design. Bioinspiration & Accessed:2021-02-01.
Biomimetics, 14(4):046008, 2019. [21] Mark W Mueller, Michael Hamer, and Raffaello D’Andrea.
[9] Mostafa RA Nabawy and William J Crowther. The role of the Fusing ultra-wideband range measurements with accelerome-
leading edge vortex in lift augmentation of steadily revolving ters and rate gyroscopes for quadrocopter state estimation. In
wings: a change in perspective. Journal of the Royal Society 2015 IEEE International Conference on Robotics and Automa-
Interface, 14(132):20170159, 2017. tion (ICRA), pages 1730–1736, May 2015.
[10] Dong Xue, Bifeng Song, Wenping Song, Wenqing Yang, [22] Matěj Karásek, Florian T Muijres, Christophe De Wagter,
Wenfu Xu, and Tao Wu. Computational simulation and free Bart DW Remes, and Guido CHE de Croon. A tailless aerial
flight validation of body vibration of flapping-wing mav in for- robotic flapper reveals that flies use torque coupling in rapid
ward flight. Aerospace Science and Technology, 95:105491, banked turns. Science, 361(6407):1089–1094, 2018.
2019. [23] Taimur Ali Shams, Syed Irtiza Ali Shah, Ali Javed, and Syed
[11] JL Verboom, Sjoerd Tijmons, Christophe De Wagter, Hossein Raza Hamdani. Airfoil selection procedure, wind tun-
B Remes, Robert Babuska, and Guido CHE de Croon. Atti- nel experimentation and implementation of 6dof modeling on
tude and altitude estimation and control on board a flapping a flying wing micro aerial vehicle. Micromachines, 11(6):553,
wing micro air vehicle. In 2015 IEEE International Confer- 2020.
ence on Robotics and Automation (ICRA), pages 5846–5851.
[24] Li Danjun, Zhou Yan, Shi Zongying, and Lu Geng. Au-
IEEE, 2015.
tonomous landing of quadrotor based on ground effect mod-
[12] Zhi Ern Teoh, Sawyer B Fuller, Pakpong Chirarattananon, elling. In 2015 34th Chinese Control Conference (CCC), pages
NO Prez-Arancibia, Jack D Greenberg, and Robert J Wood. 5647–5652. IEEE, 2015.
A hovering flapping-wing microrobot with altitude control and
passive upright stability. In 2012 IEEE/RSJ International Con-
ference on Intelligent Robots and Systems, pages 3209–3216.
IEEE, 2012.
[13] Diana A Olejnik, Bardienus P Duisterhof, Matej Karásek,
Kirk YW Scheper, Tom Van Dijk, and Guido CHE De Croon.