You are on page 1of 9

Onboard wind prediction system

Martin Mondek1
Student, Department of Control Engineering,
Faculty of Electrical Engineering, Czech Technical University in Prague, CZ

Abstract - This paper describes current development status of onboard flight control
hardware for small Unmanned Aerial Vehicles (UAV) developed by students at the
Department of Control Engineering, Faculty of Electrical Engineering, Czech Technical
University in Prague. Main onboard flight controller with proper sensors, user ground
station with MAVLink communication protocol and simple wind estimation algorithm as
one of possible onboard measurement implementations are discussed. Calibration of
differential pressure sensors and multi-hole pitot tube is described. Finally all used test
planes and UAVs are briefly introduced.

Nomenclature

௔ = the air speed vector of the plane


௚ =    ் ீ௉ௌ
= the ground speed vector of the plane

௪ =
௪௫
௪௬
௪௭ = the wind speed vector in Earth-fixed reference system
௔ = the magnitude of plane air speed vector
ࡵ࡮ = rotational matrix between Earth-fixed reference system and body-fixed system
࡮ࢃ = rotational matrix between body-fixed reference system and aerodynamic system
 = angle-of-attack
 = sideslip angle
, ,  = Euler angles (pitch, roll, yaw)
ௗ௜௙௙ = differential pressure (difference between dynamic and static pressure)
௔௜௥ = air density

I. Introduction

S MALL PLANES and various flying vehicles are very popular world-wide these days. Development of
unmanned vehicles started in military circles at the beginning of the 20th century. Their latest spread and
popularity causes the price of whole system to drop. Current UAVs are very popular for their mobility and economic
efficiency even by airplane model makers and are well liked for their wide high number of applications such as
mission accomplishment, field mapping during earthquake or floods, ground object tracking, advanced aerial
photography or some meteorology measurement.
Popularity of small UAVs spread big internet companies such as Google with their drone delivery system [16] or
Amazon's system Amazon Prime Air [15]. These systems are essentially similar to small hobbyist systems -
ArduPiot[10] or Pixhawk[11] - introduced in section 2A. They usually provide standard control and sensor
equipment to let user to control UAV remotely or even implement some autopilot systems. Lot of these systems are
open source. In this paper similar flight control system with custom ground station developed within students
activities at the Department of Control Engineering, Faculty of Electrical Engineering, Czech Technical University
in Prague is described.

1
Czech Technical University in Prague, Technická 2, 16627 Prague, mondemar@fel.cvut.cz
1
American Institute of Aeronautics and Astronautics
This project is developed to provide hardware support for wind estimation algorithms. An introduction to wind
prediction is present. It is based on paper [1] published for 20th International Conference on Process Control.
Physics background for wind estimation algorithms or flight dynamics is not provided, an interested reader can
found detailed information in [2, 3].
Implementation of these wind prediction algorithms brings specific requirement. Onboard control system must
be able to measure airspeed of the plane, angle-of-attack and sideslip angle. For these purposes special measurement
board with 5-hole pitot tube was developed and it is introduced in Section 2B.
Organization of this paper is as follows. In section 2 wind estimation algorithm and measurement error analysis
is introduced. Section 3 focuses on measurement and control hardware, used on-board sensors, ground station and
communication protocol between devices is described. Section 4 provides brief description of used UAVs. In section
5 pressure sensor calibration and data analysis is presented. Finally in Section 6 conclusions and future research
plans are provided.

II. Wind prediction algorithm


This section briefly describes computational algorithm and its measurement sensitivity. More details can be
found in paper [1] submitted for 20th International Conference on Process Control 2015.

Wind speed can be computed using vector Equation 1. This equation is


shown in Fig. 1.

௚  ௔  ௪ Eq. 1

Wind speed vector expressed in the Earth-fixed frame can be expressed as


follows.

௪௫ ௔
௪௬   
 ࡵ࡮ ࡮ࢃ  0 
Figure 1. Wind triangle.
Eq. 2
௪௭
Computation of wind speed from
ீ௉ௌ 0 ground and air speed.

ࡵ࡮ and ࡮ࢃ are the transformation matrices. Using these we can transform expressed in one coordination
system to another. In this particular case we are transforming from aerodynamic frame to body-fixed frame using
matrix ࡮ࢃ and then from a body-fixed frame to Earth-fixed frame using ࡮ࢃ . These matrixes are defined in
Equation 3.

ࡵ࡮  Eq. 3

࡮ࢃ 

If we study relation between measurement error of listed variables (pitch, yaw, roll, GPS speed, airspeed, angle-
of-attack, sideslip angle) and total error of wind speed estimation, we obtain various results. We can even study

Figure 2. Error analysis. Relation between pitch angle Figure 3. Error analysis. Relation between sideslip
measurement error and total wind speed estimation angle measurement error and total wind speed error
error based on change of heading. based on change of roll.
2
American Institute of Aeronautics and Astronautics
cross-dependence between measured variables considering different heading or pitch angle. Some selected graphs
are shown in Fig. 2 and 3.
From graph 2 it is obvious that total error in wind speed measurement depends on heading if pitch angle is not
measured correctly. If plane is flying in the same direction as wind (0° from direction of the wind) total error is
increasing quadratically in relation with pitch error contrary to flying 90° from wind direction. Then pitch angle
measurement error does not have influence on total error. In Figure 3 it is shown that if sideslip angle measurement
error is present, change of total error does not depends on actual roll angle value.
Developed algorithm was precisely tested using realistic Simulink models for random flight missions and
different flight conditions. It can be shown that algorithm works very well even for measurement bias.
Analysis of measurement errors introduced in [1] gives important data for future expansion of wind speed
estimation algorithms using advanced filtration methods such as Kalman filtering or sensor fusion. Implementation
of derived algorithms is planned for Spring 2015.

III. Flight control hardware

A. Onboard flight control unit


For onboard computing, signal and measurement processing some of commercially available flight units were
considered (Fig. 4). These control units are mainly used for civilian tasks as aerial photography, mapping or
research. These days large groups of hobbyist are speeding up the development of UAV control platforms.
Complete flight control boards usually contain simple processor unit, but with enough computational power.
Users are then able to implement complicated control system or advanced measurement evaluation algorithms such
as sensor fusion or Kalman filtering.

Figure 4. Several flight control platftorms. a) OpenPilot, b)Ardupilot APM, c) Paparazzi, d) Pixhawk
One of many low-cost types of autopilot systems is Ardupilot. It allows the user to create fully autonomous
vehicle. It is based on open source firmware adapted for various usage such as planes, multicopters or helicopters.
Hardware of this unit includes basic telemetry sensors such as 3-axis gyro/accelerometer and magnetometer,
pressure sensor, GPS module and onboard data logging memory and some advanced flight control algorithms are
implemented (e.g. GPS mission performance, auto takeoff and landing). More details can be found in Ref. [10].
For educational purposes, onboard flight
control unit (Fig. 5), developed and custom
made at CTU within a student's project [6],
was selected. It is used as main
measurement and signal processing unit and
match the quality of commercial systems.
Moreover it was developed especially for
small UAV described in Section 4, which is Figure 5. Main flight control unit with X-Bee module
used for testing and collecting data based on
algorithms described in Section 2.
The "heart" of our control board is small powerful ARM microcontroller (STM32F100RB, [4]). This 32-bit
RISC core microcontroller operates at a 24 MHz frequency and incorporates embedded memories (Flash 128
Kbytes, SRAM 8Kbytes). Communication with external sensors using SPI or I2C bus or asynchronous serial
protocol is possible and it includes one 12-bit ADC converter for analog measurements (for pressure sensors, see
section 3B).
For inertial navigation system (INS), magnetometer (HMC5883L) and full inertial measurement unit
(LSM330DL) is used, which includes 3-axis gyro and 3-axis accelerometer connected through I2C bus. The main
sensor used for localization and navigation is a GPS receiver based on GPS chip MediaTekMT3329. Additional
flash memory is present to log all required variables.
3
American Institute of Aeronautics and Astronautics
One of most important pieces is fast and reliable
duplex communication channel between ground
station and flight control unit. To fulfill this wireless
communication commercially available XBee modules
are use. For more details see section 2C.

B. Pressure measurement board and pitot tube


As described in section 2, for accurate estimation Figure 6. Basic measurement system. Simple hobbyist
of wind speed precision measurement sensors must be pitot tube and angle-of-attack probe.
used. In [6] was introduced system to measure airspeed
and angle-of-attack (Fig. 6) This system consist of basic pitot tube to measure airspeed and simple probe for angle-
of-attack measurements.
Based on experiments in small wind tunnel, this system is not very suitable for real world applications due to
unexcepted mechanical oscillations of the probe. Lack of sensors for
measuring sideslip angle is big disadvantage too.
Application of avanced multi-hole pitot tube is suggested as an
alternative to mechanical probes. An example of professional and
comercially available multi-hole probe with measuring system is in
figure 7. This probe measures all requiered variables (air speed,
angle-of-attack and sideslip angle) with good precision and at the
sime time. More information can be found in [18]. Unfortunately Figure 7. Advanced multi-hole pitot tube
price of this probe is set by its reliability and all certifications to be with professional measuring device.
used on real planes. For our purposes - measuring data on small Aeroprobe [18].
UAV - price is unnecessarily high.
Own 5-hole pitot tube was developed in collaboration of CTU
Mechanical Engineering student Vojtěch Rubáš and VZLU Praha to
precisely fit in small UAV (See Section 4). This pitot tube (Fig. 8) is
currently in production and its precision calibration and field tests
are planned.
For the measurement of airspeed, angle-of-attack and sideslip
angle differential pressure sensors are used. Due to clever Figure 8. Advanced custom made 5-hole
construction of 5-hole pitot tube, we measure 3 differential pitot tube. Diameter: 6 mm, length with
pressures - difference between dynamic (front hole of pitot tube) mounting: about 50mm.
and static pressure gives us after using Equation 4 true airspeed of plane.

௔  
ଶ௉೏೔೑೑
ఘೌ೔ೝ
Eq. 4

Difference between pressure in left and right hole gives us sideslip angle and difference between upper and
lower hole we get angle-of-attack. All computations algorithm need to be precisely calibrated in wind tunnel.
Special pressure board as seen in Figure 9 was developed [8] to provide interconnection between differential
pressure sensors (FreeScale MPXV7002DP, +- 2kPa, 5V) and 12 bit ADC converter (up to 16 channels) of our
flight control unit. Three sensors are mounted on board alongside terminal blocks to provide cable connection to
microcontroller and some additional parts for power
supply.
Data from all sensors are logged in frequency of
10 Hz. Time required for analog to digital conversion
is much smaller than periodical logging time.
Moreover data from these differential pressure
sensors can be logged at different frequency rate
(50Hz) to provide more data for computational and
wind estimation algorithms and advanced filtering
[2]. The calibration of onboard pressure sensors is
Figure 9. Board for measuring differential pressure. provided in Section 5.

4
American Institute of Aeronautics and Astronautics
C. Ground station
The hardware of the ground station and low level software functionalities are based on flight control unit board
(See Fig. 10). Same microcontroller is used, but accessories to complete functionality of this controller are different.
Four mechanical switches, several buttons and four trimmers are added to provide simple interaction between the
plane and the pilot or some software ground system running on computer. Additional graphical LCD display and
several USART ports are included. There are two main tasks which ground station must complete without
unnecessary errors.
First task is to resolve signals for onboard servos from the coded signal coming out from RC transmitter
connected to the ground station through the standard trainer cable. This coded signal is read by the ground station
electronic using interrupts and precise timers and used as input values for the onboard controller. Example of servo
control PPM multiplexed signal can be seen in Figure 11.

Figure 10. Ground control station. Figure 11. Pulse-position signal. Multiplexed signal from
RC transmitter.
The second important task of the ground station is to securely transport control signals from RC transmitter to
the onboard control system. As described in Section 2A Xbee module is used to provide wireless communication.
Unfortunately this type of communication has no acknowledgment of the correctness of the sent data. Some of this
communication errors in servo signals can shift control surfaces in unwanted direction and in an extreme cases can
cause stall or crash of the plane.
To avoid these unwanted faults lightweight MAVLink communication protocol was implemented. This very
efficient protocol inspired by CAN and SAE AS-4
standards adds advantage in predefined library
messages and checking correctness of data using
checksums. Description of MAVLink packets can be
seen in Figure 12 and explained in table 13. More
Figure 12. MAVLink frame. Packet anatomy information and details about this communication
protocol can be found in Ref. [17].

Byte Content Explanation


STX Packet start sign Indicates the start of a new packet.
LEN Payload length Indicates length of the following payload.
SEQ Packet sequence Each component counts up his send sequence. Allows to detect packet loss.
SYS System ID ID of the SENDING system. Allows to differentiate different MAVs on
the same network.
COMP Component ID ID of the SENDING component. Allows to differentiate different
components of the same system, e.g. the IMU and the autopilot.
MSG Message ID ID of the message - the id defines what the payload "means" and how it
should be correctly decoded.
Payload Data Data of the message, depends on the message id.
Checksum Low byte, high byte ITU X.25/SAE AS-4 hash
Table 13. MAVLink frame. Content explanation.
5
American Institute of Aeronautics and Astronautics
Based on Message ID we can distinguish several types of MAVLink messages. These messages can be used for
sending HeartBeat, which is similar to networking utility Ping - checking if connection is alive; sending onboard
sensor data or position of the plane or servo commands. MAVLink messages can even carry data of video stream
from onboard camera.
Using MAVLink protocol brings another advantage apart from checking errors in communication. Since it is
very common protocol implemented in various hobbyist or professional systems protocol has been implemented in
different programming languages such as C or Python.
Standardized libraries are easy to use and reduce the time required for full implementation of message coding
and decoding. Process of creating message follows:

...
\\ Mavlink ADC Message
\\ adc[] - voltage value from ADC
mavlink_msg_ap_adc_pack(system_id, MAV_COMP_ID_IMU, &msg, adc[0], adc[1], adc[2], adc[3],
adc[4], adc[5]);
mav_len = mavlink_msg_to_send_buffer(buf, &msg);
sendUART1((char*)&buf[0],mav_len);
...

Decoded example of MAVLink packet sent via asynchronous channel carrying some ADC data (airspeed, angle-
of-attack, sideslip angle) can be found in Figure 14. This type of message can contain three more 16 bit values.

Figure 14. MAVLink frame. Decoded ADC data message using asynchronous serial communication.

IV. Pressure sensors calibration


Precise calibration of sensors is very important to
correct computation of the wind speed. Several
experiments in wind tunnel were performed to generate
some source data for developing correct computational
algorithm. Used wind tunnel (Fig. 15) had 1.8 m in
diameter with maximum air flow speed at ௔௜௥  55 m/s.
For our purposes this maximum speed is unnecessary, our
airplane models are constructed to maximum speed about
௔௜௥  35 m/s.
Used pitot tube is standard measuring probe with
rounded head. This well-known head shape of multi-hole
pitot tube reduces radical differential pressure drop
caused by different aerodynamic angles unlike conical
shaped pitot tube heads.
Simple experiment is shown in Figure 16. The angle-
of-attack was set to   10°. and the side slip angle was
set to   5°. Then from 20 to 50 seconds the airspeed in
wind tunnel was set to ௔௜௥  10 m/s, then between 70
and 90 seconds to ௔௜௥  20 m/s and 110 second was set
to ௔௜௥  30 m/s. At the time of measurement indoor
temperature was   12.6 °C and measured air density
was ௔௜௥  1.18 kg/mଷ .
Figure 15. Generic pitot tube in wind tunnel.
From figure 16 we can immediately see that measured
Calibration of pressure sensors in wind tunnel
differential pressure is quadratically dependent on
owned by Aerospace Research and Test
airspeed (see Eq. 4) flowing around pitot tube.
Establishment (VZLÚ).

6
American Institute of Aeronautics and Astronautics
Figure 16. Pressure sensors calibration data. Sample experiment, angle-of-attack = 10°, sideslip angle = 5°.
The airspeed computation algorithm is based on graph showed in Figure 17. In this experiment the airspeed in
wind tunnel was increased by 2,5 m/s per step and after reaching 30 m/s the airspeed was decreased by 5 m/s.
Simple noise filter was applied to raw data and computational mechanism between voltage from ADC
converters and measured differential pressure was developed. Change of 1 mV in voltage from pressure sensor
corresponds to change of 1,17 Pa in differential pressure measured by this pressure sensor. This constant is shown in
computational mechanism in Equation 5.

$ௗ௜௙௙  %஺஽஼ 2300& ∗ 1,17 Eq. 5

Another constant in Equation 5 is equal to 2300. It is bias caused by usage of specific type of differential
pressure (±2 kPa). This bias can be computed in initialization phase as a mean value of several measurement values.
The sensitivity of airspeed and differential pressure measurement can be increased using another pressure sensor
(e.g. 0-1 kPa).

Figure 17. Pressure sensors calibration data. Converted output Figure 18. Pressure sensors calibration
voltage to pressure. data. Measured speed of airflow.

Combining Equation 4 and 5 and plotting the results we obtain data showed in figure 18. This resulting airspeed
is same as the speed of air flow obtained from wind tunnel build-in measurement units.
Different and more difficult approach is taken to compute angle-of-attack and sideslip angle. According to
references [19, 20] angle-of-attack and sideslip angles are obtained using coefficients #ఈ and #ఉ which depends
linearly on measured angles. These coefficients are as follows,

#ఈ  $ఈ /$ௗ௬௡ #ఉ  $ఉ /$ௗ௬௡ Eq. 6

where $ఈ is difference pressure between upper and lower input hole of pitot tube, $ఉ is difference pressure
between right and left input hole of pitot tube and $ௗ௬௡ is dynamic pressure (e.g. difference between middle input
hole and static input holes).
However, these equations involves dividing by zero, when dynamic pressure is 0 Pa. Experimentally was found,
that minimum suitable air speed for correct measurement of aerodynamic angle coefficients is 10 m/s and optimal
airspeed for this measurement is over 15 m/s. This problem shows Figure 19.
When airspeed reaches 15 m/s, coefficient drops and then relation between coefficient and alpha becomes nearly
linear.
7
American Institute of Aeronautics and Astronautics
Figure 19. Pressure sensors calibration data. Angle-of-attack coefficient measurement.

Similar problem occurred during measuring sideslip angle too. It could be caused by instable pitot tube
mounting or by imperfect angle setting. However precise measuring of angle-of-attack and sideslip angle is very
important for wind estimation algorithm, so data collected within this measurement will be more analyzed and some
new measuring sessions will be probably given in the future. According to obtained results, advanced filtering
method should be implemented to perform better estimating and measuring results.

V. Test planes
The aircraft control system modularity provides
various forms of its usage. The system was tested
using light RC model of CESSNA 182 (see Fig. 15)
made from expanded polypropylene material (EPP).
The main goal of creating modular control system
was to implement the wind estimation algorithm in a
UAV developed at VZLU within a CTU students' Figure 15. Small UAV. RC model CESSNA 182.
project (Fig. 16, 17, [7]). This plane is 1010 mm long,
has 2000 mm wing span, weights about 4 kg and has
special design of wings. The plane is made by
combination of plywood, balsa, carbon supports and
polystyrene. It can carry onboard camera to provide

Figure 16. Small UAV. 3D students' model. Figure 17. Small UAV. Size description.
digital record of flight or to perform other missions such
as terrain mapping or ground vehicle tracking.

All wind estimation algorithms and systems shall be fully implemented and tested during flight tests planned for
spring 2015.

8
American Institute of Aeronautics and Astronautics
VI. Conclusion
A flight control system was developed to support wind estimation projects at DCE FEE CTU. Onboard flight
control system with special pressure measuring board and custom ground station was described. Communication
protocol between control system and ground station was implemented and explained. Finally pressure sensor
calibration with proper computational algorithms were described and sample data were collected and presented.

Acknowledgments
Author would like to thank Martin Hromčík for his helpful paper guidance and Pavel Hospodář for his help
during wind tunnel measurements.
This research was supported by the Czech Science Foundation (GACR) under contract No. GA13-06894S. This
work was created within project "Velká infrastruktura Aerodynamických tunelů". This project is part of program
LM2011016/Aerodynamické tunely with financial support from Ministry of Education, Sport and Youth Czech
Republic within "Projekty velkých infrastruktur pro VaVaI" activities.

References

[1] Hromčík, M. and Mondek, M., On-line on-board wind estimation system for small UAVs, 20th International Conference
of Control Engineering, 2015.
[2] Nemra, A. and Aouf, N., Robust INS/GPS Sensor Fusion for UAV Localization Using SDRE Nonlinear Filtering, Sensors
Journal, IEEE , vol.10, no.4, pp.789,798, April 2010
[3] Introduction to aircraft flight dynamics, American Institute Of Aeronautics & Astronomy, Inc.. Virginia: Reston, 1998.
[4] STM32F100RB datasheet, STMicroelectronics, Available at:
http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1031/LN775/PF216844?sc=internet/mcu/product/216844.jsp
[Accessed 10 Feb. 2015].
[5] Unmanned aerial systems, Fort Leavenworth, Kan.: Combat Studies Institute Press. 2010.
[6] J, Halgašík, Flight Control System Unit for Small UAV Aircraft, Diploma thesis. CTU Prague, 2014.
[7] P. Adámek, Návrh bezpilotního prostředku, Diplomová práce. ČVUT Praha, 2014.
[8] P. Pahorecký, Autopilot pro UAV letoun, Diplomová práce. ČVUT Praha, 2015.
[9] J. Novák, Sestavení matematického modelu a návrh řídících algoritmů pro UAV , Diplomová práce. ČVUT Praha, 2015.
[10] Ardupilot [online], Available at: http://code.google.com/p/ardupilot-mega/wiki/Introduction [Accessed 10 Feb. 2015].
[11] Openpilot [online],
Available at: http://www.openpilot.org/products/openpilot-Revolution-platform [Accessed 10 Feb. 2015].
[12] Pixhawk [online],
Available at: https://pixhawk.ethz.ch/px4/modules/px4fmu [Accessed 10 Feb. 2015].
[13] Ed Darack, A Brief History of Unmanned Aircraft [online], Air & Space Magazine Available at:
http://www.airspacemag.com/photos/a-brief-history-of-unmanned-aircraft-174072843/?no-ist [Accessed 10 Feb. 2015].
[14] Keane, J. F. and Carr, S. S., A Brief History of Early Unmanned Aircraft [online], Johns Hopkins APL Technical digest,
Volume 32, Number 3 (2013)
Available at: http://www.jhuapl.edu/techdigest/TD/td3203/32\_03-Keane.pdf [Accessed 10 Feb. 2015].
[15] Amazon.com, Inc., Amazon Prime Air [online],
Available at: http://www.amazon.com/b?node=8037720011 [Accessed 10 Feb. 2015].
[16] Tanya Lewis, 'Project Wing': Google Unveils New Drone-Delivery System [online], LiveScience.com
Available at: http://www.livescience.com/47617-google-drone-delivery-project.html [Accessed 10 Feb. 2015].
[17] MAVLink Micro Air Vehicle Communication Protocol [online],
Available at: http://qgroundcontrol.org/mavlink/start [Accessed 10 Feb. 2015].
[18] Conventional multi-hole probes [online], Aeroprobe corporation,
Available at: http://www.aeroprobe.com/probes/view/conventional-multi-hole-probes [Accessed 10 Feb. 2015].
[19] Samson Siu Truong, Conical Probe Calibration and Wind Tunnel Data Analysis of the Channeled Centerbody Inlet
Experiment, NASA Dryden Flight Research Center, Edwards, CA, 93523
[20] Akshoy Ranjan Paul, Ravi Ranjan Upadhyay and Anuj Jain, A novel calibration algorithm for five-hole pressure probe,
International Journal of Engineering, Science and Technology Vol. 3, No. 2, 2011, pp. 89-95

9
American Institute of Aeronautics and Astronautics

You might also like