2. 2
Abstract
In this project, the default pressure sensor on the Hummingbird made by AscTec will be tested
through several measurements. Since its performance is determined as insufficient to perform
automatic altitude control of the quadrotor, other choices for distance measuring sensors will be
discussed and tested, such as ultrasonic and infrared sensors. All the experimental data and
conclusions drawn from the experiments will be provided for each sensor.
4. 4
Introduction
In this project, a commercial quadrotor is transformed from manual control to automatic control
with a special focus on altitude control. The commercial quadrotor will need to keep the same
altitude with 2 cm from minimum to maximum. The commercial quadrotor has some built-in
sensors that can measure altitude, however, they do not fit the desired requirements, e.g. with
respect to stability and accuracy. The task of this project is to select extra distance measuring
sensors to integrate with the commercial quadrotor and to test their performance with respect to
accuracy of measurement, detection range, and influence of object shape/ground level‘s surface.
System Description
In this project, a quadrotor from Ascending Technologies, called AscTec Hummingbird [1], is
used. Hummingbird has a few essential characteristics, e.g. the low level processor (LLP)
ensures a highly stable flight behavior and the high level processor (HLP) controls the
Hummingbird according to the user’s programming. On the hardware side, the Hummingbird
has four 8 in long propellers, can output a maximum thrust of 20 N, weighs 0.5 kg, and has
maximum takeoff weight of 0.71 kg. Moreover, the Hummingbird is equipped with the
following sensors: a pressure sensor, an acceleration sensor, a yaw gyro sensor, a pitch gyro
sensor, a roll gyro sensor, an AscTec 3D-MAG (compass sensor), and a GPS; however, those
sensors may not be active or work in some environments or control modes, for example, the GPS
does not work indoors.
The Hummingbird can be programmed using two different programming environments: the
AscTec SDK to program in C language or AscTec Simulink Toolkit to work with MATLAB
Simulink. In this project, the AscTec SDK is used. Furthermore, AscTec provides two
communication tools: the AscTec Communication Interface and the AscTec Autopilot. Those
two communication tools can display the values for different sensor readings and record them,
but they still have some lacking functionality. For instance, AscTec Communication Interface
only works on Linux systems and needs an additional programming to record the data. This
takes additional time for a user who is not familiar with Linux. Also, Asctec Autopilot can only
record certain data such as speed, battery life. Additionally, those two communication tools are
working in the two different level processors: in the LLP (low level processor), the user only can
use AscTec Autopilot to collect data; it does not work with AscTec Communication Interface.
On the other hand, the HLP (high level processor) can only collect data using AscTec
Communication Interface, not AscTec Autopilot. Nonetheless, the Hummingbird is still easy to
program and monitor.
Original System
The non-functional GPS sensor in an indoor environment is the major issue in this project since
the project is all about altitude control. In this case, the user can only rely on the pressure sensor
on the Hummingbird, the MPXA6115A, made by Freescale [2]. According to the datasheet, this
5. 5
pressure sensor has some desirable features, such as being resistant to high humidity. It has a
1.5% maximum error over a temperature range from 0º to 85º C. It measures in a range from 15
kPa to 115 kPa and has 45 V/kPa sensitivity. It takes a 1 ms response time and 20 ms warm-up
time. All measurements are taken when VS = 5.0 Vdc and Ta = 25º C. Its transfer function is
given by Vout = Vs* (0.009 * P - 0.095) ± (pressure error * temp. factor*0.009*Vs ), where Vs=
5.0 ± 0.25 Vdc, see Figure 1. The pressure error band in the transfer function is ±1.5 kPa from 15
kPa to 115kPa, and the temperature factor is 1 when temperature is between 0º and 85º C. In to
Figure 1, it shows the linear regression relationship between pressure and voltage with minimum,
maximum and typical measuring range; however, the stability and accuracy does not show in
Figure 1. The user can obtain the stability and accuracy by experiment.
Figure 1. Transfer function of pressure sensor.
Selection Criteria for Additional Distance Sensors
To fix this lacking range, it was decided to add distance-measuring sensors to the Hummingbird.
Several distance measuring sensors can be found in the market, but only few sensors can be used
in this project, e.g. because of take-off weight constraints.
Many sensors have the same functionality but have different ways to measure distance and
have different weights. For distance measurements, the team is limited to three types of sensors:
infrared sensor, ultrasonic sensor and laser sensor. The infrared sensor uses light to measure
distance, and it is lightweight. Since it measures distance by light, it responds fast compared to
an ultrasonic sensor that uses ultrasonic waves to measure distance. However, the infrared
sensor can only work in a certain range, e.g. the Sharp infrared sensor (GP2Y0A41SK0F) can
only measure from 4 to 30 cm [3]. This means that several infrared sensors would have to be
added to the system to cover all the desired range of 4 to 150 cm.
The ultrasonic sensor is lightweight and can work on low voltage. Most ultrasonic sensors
can have large distance measuring range, e.g. from 2 cm up to 3 m for the ultrasonic sensor
6. 6
Ping))) [4], which is more accurate than pressure sensor on the Hummingbird. Yet, it is slow to
respond and it will influence the performance of Hummingbird.
Laser sensors have the most accurate measurement in the three sensors. They do not have
short distance measurement limit, like ultrasonic sensor, and are as precise as infrared sensors.
However, Laser sensors are heavier and also use more power, thus decreasing the operating time
of the Hummingbird significantly even the Hummingbird can carry it. Given these
considerations, it was decided to integrate the ultrasonic sensor and two different-range infrared
sensors to reach the project requirement.
Pros Cons
Ultrasonic sensor - Lightweight.
- Wide detection range.
- Middle distance measuring range.
- Measurement is less precise.
- Slow feedback.
Infrared sensor - Lightweight.
- Fast feedback.
- Measurement is precise.
- Narrow detected range.
- Limited distance measuring
range.
Laser sensors - Fast feedback.
- Measurement is precise.
- Long distance measuring range.
- Narrow detection range
- Heavyweight
- Use more power.
Table 1: Pros and cons of the different sensors.
SensorTesting
In this section, three different sensors will be tested. The on-board pressure sensor will be tested
for 3 different experiments:
Measure height from same place/height for a certain time.
Measure various heights on a small scale.
Measure different height on a large scale.
The ultrasonic sensor will tested for 3 similar experiments as the pressure sensor, e.g. take
different measurement for different distances, but also consider the influence of the angle and
surface of an object. The infrared sensor will be tested for distance measurement, angle
measurement and color detection. Based on those testing result, recommendations on additional
sensors will be provided.
Pressure Sensor Testing
Since the pressure sensor is mounted on the Hummingbird, the user needs to be careful to not let
the sensor get influenced by other outside variables, such as electrical flux. In this task, all of the
experiments were recorded in an indoor environment with minimum environmental impact, such
as low AC wind draft and nearly constant temperatures. During the testing, all of the motors and
7. 7
GPS on the Hummingbird were shut off/inactive. In Figure 2, the Hummingbird stayed in the
same place and measurements were taken for five minutes using the pressure sensor. The figure
depicts that the difference between the minimum and maximum measured height was close to
one meter. It also shows that the sensor remains stable for the first two minutes. The measured
height decreases between 2 and 3 minutes, but increases from 3 to 5 minutes. Unfortunately,
there is no data to show why this happens. The mean for this experiment is 0.15 m. Based off
this experiment, the team understands that the sensor used alone will not produce the desired
result.
Figure 2: Maximum/Minimum Distance Recorded by Sensor
The second experiment measured at different heights in a small scale. This experiment
contains six different minor experiments (three minor experiments with two different directions:
going up and going down). The distances of going up are from 0 m to 0.78 m, 0 m to 1.8 m and
0 m to 0.32 m to 0.73 m to 1.21 m to 1.8 m, continuously. The distances going down are the
respective ones. For the first minor experiment from 0 m to 0.78 m and 0 m to -0.78 m, the
measured height has a huge variation between each direction. In Figure 3 the red line shows the
received measurement from 0 m to 0.78 m; however the means are 0.41 m and 1.27 m as
compared to 0 m and 0.78 m. The difference between two means is 0.86 m. It is in a 10 % error.
The blue line in Figure 3 shows the received data from 0 m to -0.78 m. In this data set, it shows
that the means are 0.23 m at 0 m, and -0.33 m at -0.78 m. The difference between two means is
only 0.56 m. It is not an accurate testing experience as the results yield an error of almost 30 %.
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0 500 1000 1500
height(m)
measurement (1 per200ms)
Height
8. 8
Figure 3: The height measured from 0 to 0.78 m (red) and the height measured from 0 to -0.78 m (blue)
The second minor experiment is from 0 m to 1.8 m and 0 m to -1.8 m. Figure 4 shows
Hummingbird going up (blue line) and down (red line). The means of 0 m and 1.8 m are 0.38 m
and 2.19 m, respectively. The difference between the two means is 1.81 m, implying a good
measurement. The means of 0 m and -1.8 m are -0.094 m and -1.64 m. The difference between
the two means is 1.55 m, yielding a 14 % error.
Figure 4: The height measured from 0 to 1.8 m (blue) and the height measured from 0 to -1.8 m (red)
These two minor experiments, which are difference in height between 0.78 m and 1.8 m, it
demonstrated a pattern during these two experiments: measurements are more accurate when the
Hummingbird is going up and less accurate when it is going down. A reason for this might lie in
the sensor design: a fluorosilicate gel isolates the die surface and wire bonds from the
environment, while allowing the pressure signal to be transmitted to the silicon diaphragm [2]. To
-1
-0.5
0
0.5
1
1.5
2
0 50 100 150 200 250 300 350
height(m)
measurement (1 per 200 ms )
Height_down
Height_up
mean:0.41m
mean:0.23 m
mean:-0.33 m
mean:1.27 m
-3
-2
-1
0
1
2
3
0 50 100 150 200 250 300
height(m)
measurement (1 per 200 ms)
Height_up
Height_down
mean:0.38 m
mean:-0.094 m
mean:2.19 m
mean:-1.64 m
9. 9
test this hypothesis, measurements were taken with the sensor in upside down position. In this
test, the result should be more accurate when the Hummingbird going down and less accurate
when it goes up. However, the pressure senor did not work like the hypothesis. As a result, the
direction of sensor’s position won’t affect the sensitivity when it goes up or down. It means the
reason why the Hummingbird is more accurate when it goes up and down was not found.
Figure 5: Mean of each different height when the quad going up (blue)down (red)
The third minor experiment is moving from 0 m to 0.32 m to 0.73 m to 1.2 m to 1.8 m and
staying at each level for 30 seconds and then repeating the same experiment in the opposite
direction, i.e., from 0 m to -0.32 m to -0.73 m to -1.2 m to -1.8 m, see Figure 5. The motivation
for this minor experiment was to find out if the error builds up for each increment/decrement in
height. The measured averages of each height are shown in Figure 5. The difference between
mean values for 0 m and 1.8 m is 1.64 m, yielding an 8 % error. It is an acceptable error range,
but it is slightly higher than the measured error in the second minor experiment. The mean
values from high to low (red curve) are 0.23 m, -0.22 m, -0.43 m, -0.72 m, -0.86 m. The
difference between the average values of 0 m and -1.8 m is -1.09 m, which is a 44 % error. This
minor experiment shows the pressure sensor has less accuracy when it goes down even when the
Hummingbird goes down slowly. Figure 5 (red) also shows that this experiment has a higher
error percentage than the experiment depicted in Figure 4 (red). There may be two reasons for
this: firstly, the longer time may affect the measurement according to the first experiment.
Secondly, the small scale measurement has less accuracy according to the second minor
-1.3
-0.8
-0.3
0.2
0.7
1.2
1.7
0 100 200 300 400 500 600 700
height(m)
measurement (1 per 200 ms)
Height_up
Height_down
µ:-0.038 m
µ: 0.207 m
µ: 0.65 m
µ: 1.15 m
µ: 1.60 m
µ:0.23 m
µ: -0.22 m
µ: -0.43 m
µ: -0.72 m
µ:-0.86 m
10. 10
experiment. Based on those three minor experiments, the team learned that the pressure sensor
does not provide a resolution that fits with desired one for small scales (from 0 meters to 2
meters).
Another set of experiments was conducted to learn how the pressure sensor operates at higher
altitudes, i.e., in a large scale. The large scale heights are from 0 m to 8.1 m, 0 m to -8.1 m and
from 0 m to 3.6 m to 8.1 m and back to 3.6 m and 0 m continuously. In these experiments, the
team expects better accuracy compare with small scale. Figure 6 shows the experiments from 0
m to 8.1 m. The mean value from 0 m and 8.1 m are 0. 44 m and 8.23 m, respectively. The
difference between this two means is 7.79 m, yielding a 3.87 % error.
Figure 6: The height measured from 0 to 8.1 m
Figure 7 shows the experiment from height 0 m to -8.1 m. The average values 0 m and -8.1
m are 0.31 m and -7.58 m, respectively. The difference between this two means is -7.89 m,
resulting in an error of 2.59 %, which is much better than in the second minor experiment (which
was from 0 m to -1.8m and had 14 % error). From these two results, the team learned that the
pressure sensors perform better when measuring higher ranges.
Figure 7: The height measured from 0 to -8.1 m
0
2
4
6
8
10
0 50 100 150 200 250 300
height(m)
measurement (one per 200 ms)
mean: 8.23 m
mean:0.44 m
-10
-8
-6
-4
-2
0
2
0 50 100 150 200 250
height(m)
measurement(one per200 ms)
mean:0.31 m
mean: -7.58 m
11. 11
The team also did an experiment regarding continuous movement at higher ranges, which is
shown in Figure 8. It turns out that the sensor is quite stable compared to the results in Figure 5.
The experiment was designed to go up and down twice. In this case, the team has three means at
0 m, four means at 3.6 m and two means at 8.1 m, which are shown in Figure 8. Every
measurement above 0 m has an error of less than 10 %, and it is better than Figure 5.
Figure 8: The height measured from 0 m to 3.6 m to 8.1 m up and down
This pressure sensor also did not have stable and repeatability property; see Appendix 1,
which shows 10 measurements at the same height/place and time duration. All measurements
are in 3 sigma rule, which means that there were no outliers; however, the desired functionality is
1 cm error for same place/height. In conclusion, the pressure sensor can accurately measure
distance at higher ranges. However, the experimental results imply that the pressure sensor will
not be a good way to measure lower heights and that additional sensors are required for this
purpose.
Ultrasonic Sensor Testing
The testing consists of two different minor tests/experiments, which evaluate the influence of an
object’s surface and angular position. Each experiment collects data from 10 cm to 160 cm
distance in 10 cm increments and with 50 measurements at each distance. The first test
compares flat and not flat surfaces and determines whether or not the surface will influence the
measurement. The second test compares different angles such that the measurement range can
be determined. Before starting the first experiment, the ultrasonic sensor was tested with an
object with flat surface, see Figure 9. It has R2 = 1 meaning that the linear regression equation
fits perfectly with data.
-1
0
1
2
3
4
5
6
7
8
9
0 200 400 600 800 1000
height(m)
measurment(one per 200 ms)
µ: 0.18 m
µ: 3.31 m
µ: 7.90 m
µ: 3.45 m
µ: 0.23m
µ: 3.50 m
µ: 7.99 m
µ: 3.52 m
µ: 0.17 m
12. 12
Figure 9: Measurement of a flat object
The first test is done using an object with a non-flat surface. According to Figure 10, the
non-flat surface casts more outliers, resulting in R2=0.7165. However, when not accounting for
the outliers, the linear regression equation is y = 1.0968x + 1.4087 and R2= 0.9997. Outliers
were defined in two different ways: the physical limitation of a maximum distance of 300 m, i.e.,
all measurements above 350 cm are considered as outliers, and the ±3 σ rule which means that
measurements in the range from µ-3σ to µ+3σ are not considered as outliers. For the distance
measurement of 140 cm in Figure 10 this means that the 6 data points around 400 cm are outliers
and so are the 2 data points at 205 cm and the 2 data points at 207 cm since µ±3σ ranges from
116.5 cm to 203.7 cm. Based on this experiment, the team learned that the surface will influence
the sensor’s detection performance. The reason may be that the reflection of ultrasound wave
did not return to the receiver on the sensor since object surface is not flat.
Figure 10: Measurement of a non-flat object
y = 1.1963x + 1.2335
R² = 1
0
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
0 10 20 30 40 50 60 70 80 90100110120130140150160170180
measurement(cm)
real distance(cm)
measurement (cm)
Linear (measurement (cm))
1/50 3/50 1/50
4/50
6/50
1/50
2/50
y = 1.1618x + 0.398
R² = 0.7165
y = 1.0968x + 1.4087
R² = 0.99970
50
100
150
200
250
300
350
400
450
0 10 20 30 40 50 60 70 80 90 100110120130140150160170
measuremt(cm)
real distance(cm)
measurement w/
outliers
measurement w/o
outliers
Linear (measurement w/
outliers)
13. 13
The second test is done using the same flat object that was used in the pre-experiment (Figure
9) to determine how different degree angles, affect the measurements. These two particular
angles, which are -15º and 15º, is the maximum angular range the sensor can detect according to
the datasheet [4]. Figure 11 shows the result for -30 º with R2 = 0.7165 when using all data points.
µ±3σ, for a distance of 100 cm is from 12.1 cm to 308.5 cm and for a distance of 110 cm is from
30.9 cm to 249.9 cm. Since the µ±3σ ranges are large at 100 cm and 110 cm the measurements
around 200 cm at 100 cm/110 cm were not defined as outlier. The R2 without outliers is R2 =
0.8675. The result of 15º is better than for -30 º, see Figure 12. It has no outliers and R² =0.9993.
Appendix 3 shows the measurements at 30º with R2≈ 0. Based on those three experiments, the
maximum angular range should be around ±15º.
Figure 11: Measurement of object at -30º
Figure 12: Measurement of object at 15º
The ultrasonic sensor has an angular detection range of around ±15º and it is more accurate at
negative angles because of the sensor physical design. To fix the increase the range, another
ultrasonic sensor may be needed. The other problem one needs to be aware of is the non-flat
25/50
1/50
11/50
13/50
y = 1.1178x + 2.4836
R² = 0.8675
y = 1.2314x - 3.188
R² = 0.7191
0
50
100
150
200
250
300
350
400
450
0 50 100 150 200
measurement(cm)
real distance(cm)
measurement w/o outliners
measurement w/ outliers
Linear (measurement w/o
outliners)
Linear (measurement w/
outliers)
y = 1.0591x + 2.7245
R² = 0.9993
0
50
100
150
200
0 50 100 150 200
measurement(cm)
real distance( cm)
measurement
Linear (measurement )
14. 14
object detection. The detection will be less precise when tested in an outdoor environment since
the environment contains more disorganized and non-flat surfaces. Lastly, all the tests were
done by using the company’s default program which consistently resulted in measured values
that were about 15% 20% too large (see slope of y in Figures 9-12)., e.g. the measurement is 60
cm when real distance is 50 cm, see Figure 9.
Infrared (IR) Sensor Testing
In this section, the infrared sensor, GP2Y0A41SK0F, with a detection range from 4 cm to 30 cm
is tested [3]. The test variables include distance, color, and angle. The first experiment is distance
measurement from 4 cm to 30 cm. This sensor does not come with a default program, so the
voltage to distance transfer equation (v(d)) is needed. The relation between voltage and distance
is provided in the datasheet, see Figure 13. The solid line is for a white object and the dashed
line for a gray object with 18% reflection rate.
Figure 13 Relationship between voltage and distance for IR sensor
To get the v(d) from datasheet, the data was imported to Microsoft Excel, and curve fitting
was applied, see Figure 14, resulting in
v(d)=10.853*(d)-0.943 with R2 = 0.997.
This v(d) equation does not include the part from 0 cm to 3 cm in Figure 13, which will be
implemented at a later point. All experiments are taken in 4 cm increments with 50
measurements at each distance, see red line in Figure 15. The experiment revealed that the
measured distance was systematically too small and the v(d) relationship was corrected to
v(d)=8.30*(distance)-0.943 - 0.7938
which was used in all following experiments, see blue line in Figure 15.
15. 15
Figure 14: Relationship between voltage and distance for IR sensor
Figure 15: the liner regression before and after
The second experiment is tested on color detection with tan color which was chosen because
most of the indoor environment was either white or tan. The result is precise, see Figure16.
y = 10.853x-0.943
R² = 0.997
0
0.5
1
1.5
2
2.5
3
3.5
0 10 20 30 40
voltage/v
distance / cm
Series1
Power (Series1)
y = 1.047x - 1.504
R² = 0.995
y = 0.765x - 0.7938
R² = 0.995
0
5
10
15
20
25
30
35
0 10 20 30 40
measurement/cm
distance/ cm
after
before
Linear (after )
Linear (before)
16. 16
Figure 16: The measurement of color
The third experiment, see Figure17, is testing the sensor performance depending on the angle
of the object for angles of 8º and -8º, which is the maximum angular range from the datasheet.
The measurements have some offset for the different angles because of the physical sensor
design. The transmitter and receiver has 1.5 cm different and it may be the reason to cause the
offset. Overall, the IR sensor is precise and stable, but the dictation range is short when
compared with the ultrasonic sensor.
Figure 17: the measurement of -8º and 8º
y = 1.0926x-1.9129
R² = 0.9903
0
5
10
15
20
25
30
35
40
0 10 20 30 40
measurement/cm
distance/ cm
measurment
y = 1.1377x - 2.3093
R² = 0.9931
y = 0.8159x + 1.0947
R² = 0.9983
0
5
10
15
20
25
30
35
0 5 10 15 20 25 30
measurements/cm
distance / cm
-8
8
Linear (-8)
Linear (8)
17. 17
Summary
From the sensor testing experiments in this project, it was determined that the ultrasonic sensor
has wider range to detect object, but it is less precise than IR sensor. Also it needs some extra
programming to correctly convert the voltage to the measured distance. The IR sensor has more
precise measurements, but a shorter range of detestation than the other sensors. The pressure
sensor can works on large scale distance measurements, but is less precise than the other sensors.
Integrating all three sensors allows maximum measurement performance which is required for
automatic height control of the Hummingbird Quadrotor..