Fulltext01
Fulltext01
This report is the result of the master’s thesis Ground Station and Hard-
ware Peripherals for Fixed-wing UAV: CyberSwan. The thesis concludes the
master’s degree with the specialization Dedicated Computer Systems at the
Norwegian University of Science and Technology (NTNU), under the De-
partment of Engineering Cybernetics. The project has taken place in the
spring semester in the 2nd year of the 2-year Master of Science study for
Bachelor engineers.
I have chosen to write this report in English. I chose this in order to learn
the the language better, since English often is used as a professional work
language.
First of all I have to thank Jon Bernhard Høstmark and Edgar Bjørntvedt
for including me in the AUAV project. Next I have to thank my super-
visor, Associate Professor Amund Skavhaug, for his guidance and positive
enthusiasm.
In addition there has been several other individuals that have helped me
during the project, and deserves a big “thank you”. Terje Haugen and Hans
Jørgen Berntsen, at the departments metal workshop, for being extremely
forthcoming and efficient making all odd parts used for mounting equipment.
Peder Martin Evjen, Radiocrafts AS, for sponsoring RF equipment. Fellow
students Audun Sølvberg, for helping me with data-logging from the IMU,
and Eirik Tveiten, for his numerous LabVIEW-tips.
Mikael K. Eriksen
i
Abstract
In this master’s thesis, a ground station (GS) for the fixed-wing UAV: Cy-
berSwan (CS), has been developed. The CS was designed for surveillance
purposes, and two other master’s theses deals with the work of making it
autonomous (Høstmark (2007) and Bjørntvedt (2007)). Having a GS will
make it possible to communicate with the CS in-flight, and present data and
video from the CS through communication devices.
The GS has been realised using LabVIEW development software from Na-
tional Instruments (2007). A CS simulator was also developed in LabVIEW
for test purposes. In addition was a Global Position System (GPS) receiver
board, and a Radio Frequency (RF) communication board, developed. The
GPS receiver was used to position the GS, and used as a source for position
correction data. The RF communication board was developed for mounting
in the CS and to be connected to its computer system to enable communi-
cation with the GS. The GS used a RF demo board for communication. A
wireless camera was mounted on the CS for in-flight video surveillance, and
a ultrasound ranging device was tested intended to be used in a autonomous
landing situation.
A hardware in the loop (HIL) test was performed to test the GS’s commu-
nication capacity. Here the developed CS simulator was used, as the CS
computer system was not completed (Bjørntvedt 2007). The test proved it
possible to transfer a CS status message at 4 Hz, making the chosen com-
munication device a good choice for the intended purpose.
iii
Contents
List of Figures ix
Abbreviations xv
1 Introduction 1
1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Current System . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Disposition of the thesis . . . . . . . . . . . . . . . . . . . . . 7
2 Background 9
2.1 GPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
System segmentation . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Differential GPS . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 EGNOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4 Development Software . . . . . . . . . . . . . . . . . . . . . . 14
LabVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
C++ with Qt toolkit . . . . . . . . . . . . . . . . . . . . . . . 16
C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
v
Contents
Qt toolkit . . . . . . . . . . . . . . . . . . . . . . . . . 17
3 System Design 19
3.1 System Outline . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.2 Hardware Selection . . . . . . . . . . . . . . . . . . . . . . . . 20
Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
NMEA 0183 . . . . . . . . . . . . . . . . . . . . . . . . 22
DGPS reference station . . . . . . . . . . . . . . . . . 24
Communication . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Visual link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Hi Cam Pro X2 system . . . . . . . . . . . . . . . . . 27
LUDA Minikameran . . . . . . . . . . . . . . . . . . . 27
Ultrasound ranging device . . . . . . . . . . . . . . . . . . . . 31
3.3 Ground Station Design . . . . . . . . . . . . . . . . . . . . . . 32
Hardware setup . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Development software . . . . . . . . . . . . . . . . . . . . . . 33
Ground station software design . . . . . . . . . . . . . . . . . 33
Message reception and transmission . . . . . . . . . . 33
Data presentation . . . . . . . . . . . . . . . . . . . . 34
Position correction . . . . . . . . . . . . . . . . . . . . 34
Navigation . . . . . . . . . . . . . . . . . . . . . . . . 34
vi
Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.4 CS orientation . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.5 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5 Development 41
5.1 Hardware development . . . . . . . . . . . . . . . . . . . . . . 41
GPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
RF board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2 Communication Protocols . . . . . . . . . . . . . . . . . . . . 46
5.3 Software development . . . . . . . . . . . . . . . . . . . . . . 50
Ground Station . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Functional description . . . . . . . . . . . . . . . . . . 50
Transceiver VI . . . . . . . . . . . . . . . . . . . . . . 52
GPS receiver VI . . . . . . . . . . . . . . . . . . . . . 59
Plotter VI . . . . . . . . . . . . . . . . . . . . . . . . . 66
IMU display VI . . . . . . . . . . . . . . . . . . . . . . 74
Sensor display . . . . . . . . . . . . . . . . . . . . . . 76
CS simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Functional description . . . . . . . . . . . . . . . . . . 78
Transceiver . . . . . . . . . . . . . . . . . . . . . . . . 80
IMU . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
GPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Servo . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Ultrasound ranging device . . . . . . . . . . . . . . . . . . . . 89
vii
Contents
6 Results 91
6.1 HIL test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Test 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Test 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Test 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Test 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
6.2 Ultrasound ranging device . . . . . . . . . . . . . . . . . . . . 94
6.3 Video test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
7 Discussion 97
7.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
7.2 Hardware choices . . . . . . . . . . . . . . . . . . . . . . . . . 98
7.3 Software choice and system design . . . . . . . . . . . . . . . 99
7.4 Recommendations for further work . . . . . . . . . . . . . . . 100
8 Conclusion 103
A DVD 105
A.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
A.2 DVD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Bibliography 109
viii
List of Figures
ix
List of Figures
x
5.48 GPS simulator block diagram. . . . . . . . . . . . . . . . . . . . 86
5.49 Servo simulator front panel. . . . . . . . . . . . . . . . . . . . . . 87
5.50 Servo simulator block diagram. . . . . . . . . . . . . . . . . . . . 88
xi
List of Tables
xiii
Abbreviations
xv
List of Tables
xvi
The higher we soar the smaller we appear to those who cannot fly.
– Friedrich Nietzsche
xvii
Chapter 1
Introduction
1.1 Background
During the fall semester of 2006, Høstmark (2006) and Bjørntvedt (2006)
started the work on the first autonomous fixed-wing unmanned aerial vehicle
(AUAV), at the Norwegian University of Science and Technology (NTNU).
Previously there have been several projects involving autonomous control
undertaked at the Department of Engineering Cybernetics; a helicopter,
CyberEagle (Ellingsen 2002), several robots for the Eurobot competition,
several under-water vehicles and continous work on a bicycle, CyberBike
(Sølvberg 2007).
The work on the AUAV resulted in a unmanned aerial vehicle (UAV) plat-
form prototype, Figure 1.1 (Høstmark 2006), and a design of the instrumen-
tation system for this prototype (Bjørntvedt 2006). The projects were con-
tinued for master’s theses and expanded into one additional field, a ground
station. The UAV was also given the nickname CyberSwan (CS).
1
1. Introduction
1.2 Motivation
The motivation for expanding the whole project into also involving a ground
station is ease of operation and to add some level of security. A ground sta-
tion will give the chance to communicate with the CS during the flight. It
will also give the possibility to monitor it’s position and other system data.
The ultimate goal would be to make the CS autonomously fly a prepro-
grammed navigation route. Positioning the ground station will also give the
CS a reference that could be used in an autonomous landing situation.
This thesis concerns the development of a ground station (GS) for com-
munication with the CS. Navigational, sensor and visual data are to be
transmitted and presented. It also imply the support of hardware peripher-
als for the CS: a communication device, a ultrasound ranger and a wireless
camera system.
The main objective is navigational support. This implies presentation of
position and other data transferred during flight. It is therefore concidered
important to have communication with the CS at all time. The CS is quite
small, and has limited space for equipment. It’s power source are batter-
ies which gives a limitation in current consumption for added electronics.
Also, noise influence on the instrumentation system have to be limited to a
minimum. Figure 1.2 gives an overview of the total CS AUAV system.
2
Motivation
The Turkish company Baykar Machine Inc. delivers complete designs from
miniature to tactical range UAV systems, both helicopter and fixed-wing
platforms are available.
Main system components such as avionics, ground control station, digital
encrypted data link, operator interface and airborne platforms are designed,
engineered and integrated in-house through research & development (R&D)
projects, where some have been coordinated with Istanbul Technical Uni-
versity (Baykar Machine Inc 2007).
One of the platforms available are the Bayraktar Mini UAV System (Figure
1.3) which provides a fixed-wing UAV design close to our own CS. The mini
UAV system is designed for aerial reconnaissance and surveillance activities
with deliveries to the Turkish Military (Franchi 2006). The V-tail form,
aerodynamically stable fixed-wing platform is designed and manufactured
in a modular fashion with materials such as carbon fiber, kevlar, glass fiber
and computer numerical control (CNC) machined aluminum parts. The
mini UAV system could be hand launched and land on its body. The power
system is composed of two electric motors mounted in the front of the main
wing.
The avionics system is specifically engineered for Bayraktar Mini UAV. Its
embedded real time software environment handles control, waypoint navi-
gation, digital communication and functions for digital image transfer. The
4
Current System
• Length: 1.2 m
• Speed: 27 - 60 knots
• Weight: 5 kg (Max.)
• Navigation: GPS
5
1. Introduction
Figure 1.3: Bayraktar Mini UAV fixed-wing platform (Baykar Machine Inc.)
Figure 1.4: Bayraktar Mini UAV System Operator System (Baykar Machine Inc.)
6
Disposition of the thesis
7
Chapter 2
Background
In this chapter background information on the GPS system and the devel-
opment software alternatives are presented.
2.1 GPS
The Global Positioning System (GPS) is currently the only fully functional
Global Navigation Satellite System (GNSS). Up until recently the system
consisted of 24 satellites, with three spare satellites in case of failure. The
satellites are distributed equally among six circular orbital planes (gps.gov
2007).
The United States Department of Defense (DoD) developed and imple-
mented the satellite network as a military navigation system (pnt.gov 2007).
It is now open to the public, and enables a GPS receiver to determine its
location, speed and direction. GPS has become a widely used aid to naviga-
tion worldwide, and a useful tool for map-making, land surveying, commerce,
and scientific uses.
System segmentation
The current GPS consists of three major segments: the space segment (SS),
a control segment (CSE), and a user segment (US) (www.aero.org 2007).
9
2. Background
Space segment
The SS is composed of the orbiting GPS satellites, also called space vehicles
(SV). The SV’s six orbital planes are centered on the Earth. They are tilted
approximately 55◦ relative to Earth’s equator, and are separated by 60◦
right ascension of the ascending node.
Orbiting at an altitude of approximately 20,200 kilometers, each SV makes
two complete orbits each sidereal day, passing over the same location on
Earth once each day. The orbits are arranged so that at least six satellites
are always within line of sight from almost everywhere on Earth’s surface.
Control segment
The CSE consists of six ground stations located around the world, which
makes sure the satellites are working properly. The master control station
at Schriever Air Force Base, near Colorado Springs, Colorado, runs the
system. The ground stations contacts each SV regularly with a navigational
update. These updates synchronize the atomic clocks on board the SVs to
within one microsecond and adjust the ephemeris of each satellite’s internal
orbital model. The updates are created by a Kalman Filter which uses inputs
10
GPS
from the ground monitoring stations, space weather information, and various
other inputs.
User segment
The user’s GPS receiver is the US of the GPS system. In general, GPS
receivers are composed of an antenna, tuned to the frequencies transmitted
by the satellites, receiver-processors, and a highly-stable clock. Many also
include a display for providing location and speed information to the user.
A receiver is often described by its number of channels indicating how many
SVs it can monitor simultaneously. Originally limited to four or five, this
has increased to between twelve and twenty channels.
GPS receivers may include an input for differential correction of the position.
Many GPS receivers can also relay position data to an external device like
a PC using the NMEA 0183 protocol. NMEA 2000 is a newer and less
widely adopted protocol. Both are proprietary and controlled by the US-
based National Marine Electronics Association (NMEA). Other proprietary
protocols exist as well, such as the SiRF and MTK protocols. The interfacing
with other devices can usually be done using a serial connection, USB or
Bluetooth.
Calculating position
A GPS receiver calculates its position by measuring the distance between
itself and three or more GPS SVs. Measuring the time delay between trans-
mission and reception of each GPS radio signal, gives the distance to each
SV since the signal travels at a known speed. In order for the distance in-
formation to be of any use, the receiver also has to know where the SVs
actually are. Therefore the GPS receiver stores an almanac that tells where
every SV should be at any given time. The signals also carry information
about the SVs location. By determining the position of, and distance to,
at least three SVs, the receiver can compute its position using trilateration.
Receivers typically do not have perfectly accurate clocks and therefore track
one or more additional SVs to correct the receiver’s clock error.
11
2. Background
The GPS system assumes the radio signals will make their way through
the atmosphere at a consistent speed. The Earth’s atmosphere slows the
electromagnetic energy down somewhat, particularly as it goes through the
ionosphere and troposphere. The delay varies depending on where on Earth
the position is, which means it’s difficult to accurately factor this into the
distance calculations. Problems can also occur when radio signals bounce
off large objects, such as skyscrapers, giving a receiver the impression that a
satellite is farther away than it actually is. Differential GPS (DGPS) helps
correct these errors. The basic idea is to use a stationary receiver station
with a known location as a reference. Since the DGPS hardware at the
station already knows its own position, it can easily calculate its receiver’s
inaccuracy. The station then broadcasts a radio signal to all DGPS-equipped
receivers in the area, providing signal correction information for that area.
This correction makes the DGPS receiver much more accurate than ordinary
GPS receivers (Environmental Studies 2007).
Accuracy and error sources
Ranging errors are grouped into the six following classes (Wormley 2007):
Table 2.1 on the facing page shows how much these errors influences the
accuracy. Typical normal accuracy for well-designed civil equipment under
nominal operating conditions should be about 10 m horizontal and 13 m
vertical for GPS and below 5 m using DGPS equipment.
12
EGNOS
2.3 EGNOS
13
2. Background
GPS Satellites
EGNOS Satellite
CyberSwan
LabVIEW
14
Development Software
15
2. Background
code is executable or not. If it’s not, error and warning feedback is pro-
vided. Debugging is also possible using execution highlightning, probing,
using break points, and single-stepping through the block diagram. Using
execution highlighting, it is possible to view an animation of the execution
of the block diagram. The animation shows the movement of data on the
block diagram from one node to another using bubbles that move along the
wires. This can also be used in conjunction with single-stepping to see how
data move from node to node through a VI. The code is compiled into exe-
cutable machine code when requested to run or upon saving. When saving
the executable and the source code are merged into a single file. The exe-
cutable runs with the help of the LabVIEW run-time engine, which contains
some precompiled code to perform common tasks that are defined by the G
language. The run-time environment makes the code portable across plat-
forms. Generally, LabVIEW code can be slower than equivalent compiled
C-code, although the differences often lie more with program optimization
than inherent execution speed.
LabVIEW provides libraries with a large number of functions for data ac-
quisition, signal generation and processing, communication, mathematics,
analysis, control and vision to name a few. This, along with numerous
graphical interface elements are provided in LabVIEW’s package options.
The LabVIEW Professional Development System allows creating stand-
alone executables and the resultant executable can be distributed an unlim-
ited number of times. The run-time engine and its libraries can be provided
freely along with the executable.
A benefit of the LabVIEW environment is the platform independent na-
ture of the G-code, which is, with the exception of a few platform-specific
functions, portable between the different LabVIEW systems for different
operating systems.
C++
16
Development Software
Qt toolkit
17
2. Background
18
Chapter 3
System Design
In this chapter the overall design of the system is outlined. The principal
system design for implementation is specified, the hardware options and
development software are evaluated and chosen. In the end the GS design
is presented.
Figure 3.1 shows the general system structure. Both the GS and the CS
needs a positioning device, and a wireless communication link is needed
between the GS and the CS in order to transmit sensor and navigation
data. A visual link and a ground ranging device are to be gathered and
mounted on the CS.
19
3. System Design
User Interface
CS Status
Visualisation
Video Display
GPS, comm. and
visual link
Positioning
The position of the GS is determined by the use of a GPS reciever. The hard-
ware system in the CS will use a GlobalSat EM-411 GPS module (Bjørntvedt
2006). The module provides a position with accuracy below 10 m, and within
5 meters with WAAS enabled. The EM-411 supports NMEA 0183 and SiRF
output protocol. To ensure minimal difference in error, numerical error par-
ticularly, this module was also chosen for the GS. This would give the GS
and the CS approximately the same error in the same area.
20
Hardware Selection
21
3. System Design
NMEA 0183
22
Hardware Selection
Value Description
0 Fix not available or invalid
1 GPS SPS Mode, fix valid
2 Differential GPS, SPS Mode, fix valid
3 GPS PPS Mode, fix valid
23
3. System Design
By using the same GPS receiver module in the GS as in the CS, both units
will have approximate the same errors when they are in the same area.
This gives the possibility of using the GS as an terrestrial reference station.
The GS’s GPS coordinates are interpolated for some time to get a position
which is treated as its absolute position. Any change in its GPS reading
compared to this position is concidered to be an error. This error is sent
to the CS as a correction signal for its position, improving it accordingly.
This method is the Differential GPS method (Section 2.2 on page 12). The
accuracy obtained by this method ranges between 1 - 3 meters, whereby the
accuracy depends on the distance to the correctional data transmitter and
the signal quality (Environmental Studies 2007). If in addition the GPS
receiver supports reception of EGNOS correction data, the accuracy should
be expected to be even better (Section 2.3 on page 13).
GPS Satellites
Correc
tion
Signa
l
CyberSwan
Ground
Station
Figure 3.3: Ground Station working as a reference station for the CyberSwan
24
Hardware Selection
Communication
25
3. System Design
Visual link
One of the possible areas of application for this system is video surveillance
and still photography. Three options are concidered:
• Digital photograpy
• Digital video
• Analog video
The available digital communication link has a low data transfer rate. The
chosen link, have a capability of 4800 bps. Regarding the limited data rate,
range and output power there are limited possibilites for additional transfer
of digital images and video on the chosen RF-link. No communication links
are currently available to make this possible. A separate communication
device for the transfer of visual information is therefore needed. With an
analog video link with output power in the range 0.1 - 0.5 W, the possible
range, dependent on modulation, will be in the area 100 - 1000 m scope. The
video quality will decrease with the distance between the camera’s transmit-
ter and reciever. Although, compared to a digital option, which will either
have a signal, or not. The analoge option will suffer signal degrated images,
but will still give an image. Therefore the analog video option is taken.
26
Hardware Selection
The Australian company Hi Cam develop video transmission for airial use.
Their Pro X2 system is a video transmitter which can be connected to any
video source. The example videos from their web page shows video of great
quality without any disturbances. These example videos are enclosed in
Appendix A. The Pro X2 it could be hidden in one of the CS’s wings, and
the camera mounted at any other spot on the CS, linking them together with
a cable. It would be an advantage to place the transimitter away from the
body, limiting it’s noise influence on the main computer system. The sysems
range is stated to be 667 m, superior to other systems performance. These
advantages made the Pro X2 system to be ideal choice. Unfortunately the
system was out of stock. Hi Cam is currently working on an updated version
with a molded casing. The new version will have an external microphone
option, but otherwise have the same features as the old version. Tables 3.6
to 3.8 contains the Pro X2 system specifications (Hi Cam 2007). The new
version was not available in time to be used in this project, so a different
camera system had to be used.
LUDA Minikameran
Researching for other cameras to compete with the Pro X2 system’s quality
and range proved to be a difficult task. The research yielded no other system
developed for airial use. As size was an important property the choices were
limited to simple mass-produced camera systems ment for home security
surveillance on ground level. The chosen camera, Luda Minikameran, has
a built in transmitter with a stated range of 100 m. Figure 3.6 on page 30
shows the camera and AV-receiver, and Table 3.9 on page 30 contains the
camera’s specifications. In order to improve the range an directional antenna
was purchased. The antenna provides a signal amplification of 19 dBi which
will increase the systems range substantially.
27
3. System Design
28
Hardware Selection
29
3. System Design
30
Hardware Selection
31
3. System Design
Hardware setup
With the hardware choices made, the physical structure of the system is as
illustrated in Figure 3.8. A portable computer is the core of the system,
running the GS software. The antenna system, with the RF antenna on
top, and a grid antenna to receive the video feed, is mounted on a portable
tripod. The electronics draws its power from a 12 V car battery or similar,
regulated individually to their specified voltage. The video is fed from the
audio-visual (AV) receiver to an individual video display or into the laptop
through a usb media adapter or similar.
Video RF antenna
display
Grid antenna
for video
reception
Laptop
RF
12 V GPS
Battery
receiver AV-
receiver
Figure 3.8: Illustration of Ground Station hardware setup.
32
Ground Station Design
Development software
C++ with the Qt toolkit gives the possibility to develop the ground station
software to satisfy own specifications. This would include: low level serial
driver development, GPS message parsing, communication protocol and GUI
development, to name a few. Still, freedom of choice is not always for the
better, meaning that this would be a big task for one person. In LabVIEW
all these properties are already available. Also, LabVIEW is commonly
used for control purposes. It is concidered that using LabVIEW (National
Instruments 2007) would increase the possibility to create a working product,
and it was therefore chosen to be used as the development software.
– Position (GPS)
– Physical orientation (Inertial Measurement Unit (IMU)
– Actuator (Servo/Receiver)
– Ultrasound and pressure sensor
• Position correction
• Navigation
33
3. System Design
Data presentation
All received data can be presented directly using LabVIEW. For the presen-
tation of the GS and CS position it is of interest to visualise this on a map.
Several professional chart plotter products are available but they are often
expensive. A cheap alternative is to use Google Earth Pro which supports
plotting. This would have been a good option, but this was not relevant
as the current maps are not detailed enough. It is also of interest to keep
everything limited to one program simplifying the flow of data. Therefore
it was chosen to develop a plotter using LabVIEW.
Position correction
Navigation
34
Chapter 4
Ground Station User Guide
This chapter presents a short guide of normal use of the GS GUI, explaining
its properties and possiblities, and its interaction with the CS. A video was
also made, and is available in Appendix A.
When starting the GS the transceiver normally would be the active panel.
This is, in addition to the GPS panel, the panels that needs to be interacted
with before the GS can be engaged. Figure 4.1a and Figure 4.1b on page 37
shows the respective panels. As the Figure’s information display message
indicates, GS is not ready- calculate GS position in GPS panel, then engage!,
one have to chose the GPS panel to calculate the GS position. Also, the
status indicator in not lit, indicating that the GS is not ready to be started.
The GPS panel has three displays and one button. The indicator on the right
is showing the current position of the connected GPS receiver. The indicator
on the left is for showing the calculated static GS position, and the indicator
in the middle will show the difference between the two other indicators, the
position error. Positive values will define a position North and East of the
GS position. A green light will indicate that the connected GPS has a valid
position, and the position should be refreshed once a second. Pressing the
Calculate GS Fix button will start the collection of position data. When
the button is released it will calculate the GS position. The position error
display should now show close to zero error, defining the correction signal
35
4. Ground Station User Guide
4.2 Operation
In the transceiver panel, the lower left section should now show the $GPGGA
string, corresponding to the GS’s position. Also, the $GSPCO string is dis-
played, changing once a second, corresponding to the position error display
in the GPS panel.
Position correction
To transfer the position correction signal to the CS, press the Transfer Posi-
tion Correction button, positioned in the lower right corner of the transceiver
panel, once. As long as the button is active, the correction message will be
sent to the CS once a second.
Ordering messages
To the right, in the middle of the transceiver panel, are five numeric controls
arranged in a column. Here one can decide what messages to receive from
the CS within one second, defined by the categories on the left of the column.
How many messages possible to receive is decided by the bandwidth of the
serial communication link between the GS and the CS. By using the RF
card developed in this project, this is limited to four messages. Ordering
more than four messages will not be taken into account, as messages will be
ordered with priority counting from the top of the column. After chosing
the number of messages wanted, using the small dials, or entered directly,
pressing the Send order button will show the $GSCTR string in the lower
left corner and transmits it to the CS. Received messages will be displayed
in the indicators and its correspondent panel: plotter, IMU and sensors.
36
Operation
37
4. Ground Station User Guide
4.3 Plotting
Map
When receiving the $CSGPS message, the plotter is fully functional. Figure
4.2 shows the plotter panel, with the CS’s position display in the lower left
corner. The top left control is the choice of what map to draw. To change
the map, th the Reset GS button has to be pressed, in order to draw the
new map. This also regards the GS position, if it has been recalculated.
Tracking
There are two choices regarding CS tracking. Either continously, or just the
current position, chosen with the CS Tracking method control. The status
window will continously tell if the GS and the CS is within the chosen map’s
38
CS orientation
area. Below the status window the current range to the CS is presented.
There is also a possibilty to save the current CS plot by pushing the Save
plot on reset button and then the Reset GS button. This brings up a dialog
to save the CS plot to a text file. This can then be examined in a text editor.
Navigation
4.4 CS orientation
When receiving the $CSIMU message, the received data updates the indi-
cators in the IMU panel, as shown in Figure 4.3. The source of the data is
the CS’s IMU giving information about its orientation in space. The roll,
pitch and yaw angles are used to rotate the 3D model, showing the CS’s ori-
entation. The model can also be rotated using the mouse, and the display
is resetted to default by pressing the Reset display button.
4.5 Sensors
The last panel contains information contained in the $CSSRV, $CSREC and
$CSOTH messages. The received messages are parsed and the information
is displayed in its corresponding indicator, as shown in Figure 4.4.
39
4. Ground Station User Guide
40
Chapter 5
Development
This chapter describes the development of the hardware and software pro-
duced according to the system design in Chapter 3. It also describes the
protocols used for communication.
The EAGLE Layout Editor (CadSoft Online 2006) was used for circuit board
layout, and the developed circuits were produced in the Department of En-
gineering Cybernetics’ workshop.
GPS
In order to use the EM-411 GPS module a power supply and a suitable com-
munication interface is needed. Since it has to be connected to a computer, a
RS-232 interface is preferable. The data sheet indicated an electical interface
with 5 V power supply and a transistor-transistor logic (TTL) level output of
0 - 2.85 V. The module was tested with a normal RS-232 transceiver, though
thought for TTL devices with a 0 - 5 V output level. Still, this worked fine,
since 2.85 V is above the transceivers “high”-level threshold. This gave a
circuit with a block schematic representation as shown in Figure 5.1. Since
there were no special demands regarding the circuit’s size, standard in stock
components were used. The result can be seen in Figure 5.2. Spacers were
mounted in order to fit the GPS module in a stable position.
41
5. Development
Using a terminal program the module was configured to only output the
$GPGGA and $GPRMC sentences as they contain the information needed.
The serial interface was changed also to 9600 baud. The protocol for chang-
ing the settings were found in the user manual enclosed in Appendix A.
5 V DC
Power Input
Power
7-25 V DC
Supply
GlobalSat
EM-411
RS-232 RS-232 GPS Receiver Engine Board
Interface Transceiver
42
Hardware development
RF board
Figure 5.3 shows the block schematic representation of the RF board pro-
duced for the CS. A low drop-out (LDO) voltage regulator is used to regulate
the inputted power from a range 4.85 - 15 V DC, down to 3.3 V DC. The reg-
ulator supplies both the RS-232 transceiver and the RF module with power.
The MAX3232 RS-232 transceiver is used to make it possible to commu-
nicate with the RF module through the RS-232 protocol. The Radiocrafts
RC1240 module is used for RF communication between the GC and CS.
The circuit board is designed to keep the size and thickness small to enable
an easy fit inside the CS. Figure 5.4 shows the produced circuit board. All
devices used on the board are of surface mount device (SMD) type. The
exception are the connectors, where the right-angle shrouded board-mount
headers are chosen. The antenna connector is of female SMA-type. It is
mounted perpendicular to the ground plane, leaving the SMA connectors
transmission line contact point parallel to the circuit board’s transmission
line. This was done first of all due to production reasons. The antenna trans-
mission line has to be routed on the top plane of the circuit board since the
ground plane is on the bottom plane. To be able to solder the transmission
line to the antenna connector, a connector for chassis mounting was chosen.
This allows the connector to be soldered directly to the transmission line.
As a result of mounting it in this way is that the antenna can easily be
fitted inside the CS’s wing length, without any chance of bulging out of its
wrapping. The connector’s screen is fixed to the ground plane with a small
bar of aluminium, using screws through the circuit board. The transmis-
sion line’s impedance is matched to 50 Ω. The impedance is defined by the
width of the transmission line, and the thickness and dielectric constant of
the circuit board’s dielectricum. Figure 5.4 shows a magnified view of the
transmission line in a circular box. The width of the line was calculated to
107.9 mil (2.74 mm) using the Microstripline Analysis & Design calculator
provided by Green Bay Professional Packet Radio (2007), giving close to 50
Ω impedance.
The module is connected to the PC at a baud rate of 19200. It then sends
the buffered data if its data buffer is full (128 byte), a unique end character is
sent, or a modem time limit is reached. It was chosen to transmit data using
a unique end charcter, line feed. The RF module was configured accordingly
using a terminal program and commands found in Radiocrafts’ RS232 user
manual enclosed in Appendix A.
43
5. Development
3.3 V DC
Power Input
Power
5-15 V DC
Supply
Radiocrafts RC1240
RF Module
RS-232 RS-232
Interface Transceiver
44
Hardware development
Camera
The Luda Minikameran was fixed to back wing on the CS, as shown in Figure
5.5. A video from a test flight is available in Appendix A.
45
5. Development
$CSIMU is collected data form the CS’s IMU measurement. This message
includes accelerations, rate of turn and roll, pitch and yaw angles.
$CSIMU,124637.000,0.01,0.00,9.81,0.01,0.02,0.03,-0.14,0.62,107.04*6B is an
example of such a message, with a detailed description in Table 5.2.
$CSSRV and $CSREC messages have the same structure. While the
$CSSRV contains information information about the servos, which are the
CS’s actuators, position. Each of the six channels can have a value between 0
46
Communication Protocols
to 255, where 0 defines a far left position, and 255 defines a far right position.
$CSREC defines the values for the same channels, but of the handheld re-
ceiver used to fly the CS manually. $CSREC,124637.000,138,157,3,170,138,0*75
and $CSSRV,124637.000,182,240,67,186,182,0*14 are examples of these mes-
sages. The latter message’s details are described in Table 5.3.
$CSOTH contains information from the other sensors available from the
CS. $CSOTH,124637.000,6.45,29.16*4F is an example of this message. First,
as in the other messages, the messages time is given, then height form the
ultrasound range sensor and air speed from the CS’s pitot tube.
47
5. Development
It was also necessary to design a few messages with a GS origin, giving the
source letters GS: $GSPCO, $GSCTR and $GSNAV.
$GSPCO contains the position correction data for the CS GPS receiver.
The correction data is the result of the GS GPS received position - the GS
position. The theory behind this is explained in Section 3.2 on page 24
A positive latitudal value defines a position North of the GS position, a
positive longitudal value defines a position East of the GS position, and a
positive altitude defines a higher altitude. The CS GPS position is corrected
by substracting the correctional data from its position. Table 5.4 contains
the details about the example sentence $GSPCO,100223.000,0.00002083,-
0.00007833,-6.9*73.
48
Communication Protocols
$GSNAV is the sentence containing the waypoint data for the navigation
route planning. $CSNAV,123152.000,6325.2600,N,01023.8800,E,6325.1400,N,
01024.3600,E,6324.9000,N,01023.94000,E*42 is an example sentence, with
details in Table 5.6.
49
5. Development
Ground Station
Functional description
The program structure consist of one main program, the GS VI, which
only job is to load the diffent VI’s developed into panels on the VI’s front
panel. Chosing a tab in the top left corner of the front panel (Figure 4.1a
on page 37) changes which VI is displayed. Each VI can be thought of as
a module working on its own, beeing coupled together by regards of data
from other VIs in order to function. The passing of information between
VIs are realised using global variables. Doing it this way made it possible
to develop each function individually before connecting them together into
one program.
The GS concists of five panels:
• Transceiver
• GPS
• IMU
• Plotter
• Sensors
50
Software development
Figure 5.6 shows the copling between the VIs. The red lines are global
boolean variables, while the blue lines are lines for passing data between the
VIs.
GS Position Calculated
GS Engaged
GPS
Plotter IMU Sensor Tranceiver
GPS Receiver RF
VI Display VI Display VI VI
VI
The GPS and the Transceiver VIs are the core part of the GS. Before it can
be used the GS’s position have to be calculated. The theory behind this is
discussed in Section 3.2 on page 24 and explained in Chapter 4 on page 35.
When this is done the global GS Position Calculated signal is set. When the
GS is engaged, by pushing the engage-button on the Transceiver VI’s front
panel, this sets the global GS Engaged signal variable. This variable, as
indicated in Figure 5.6, enables the plotter, IMU display and sensor display
VIs. The GS is now operational.
51
5. Development
Transceiver VI
The complete transceiver VI’s block diagram was to big to fit in one page.
See the pdf-file in Appendix A for the complete diagram.
The first thing that happens when the transciever VI is started is the serial
port configuration, which is executed once. Then, the VI waits for the global
variable GS position calculated and for the user to press the Engage button.
When the GS position is calculated the VI can now be in two states: engaged
or not engaged. It can only go into the engaged state if the GPS VI has
calculated the GS position and the Engage button on its front panel are
pressed.
In engaged state, which is the operational GS state, two while loop work
in parallel to communicate with the other VIs and with the CS through a
serial port. Figure 5.7 shows the reception while loop. Incoming messages
are continously received and presented in indicators on its front panel, in
addition they are written to their respective global variable. Here the global
variables from the GPS and Plotter VIs are read and written to indicators.
Figure 5.7: Receiver while loop for reception of messages from the CS.
52
Software development
The RS232 config subVI in Figure 5.8 shows how the serial port is con-
figurated. The VISA resource name decides which port is opened. In the
transeiver VI this port is hard coded to COM1. As a finished product this
could have been solved differently, for example as a choice on the GS front
panel, or with a pop-up when it’s starting. Further, configuration is set to
terminate reading on line feed character, a time out of 10 ms, and with a
data rate of 19200 baud. The subVI also sets a standard 8 data bits, no
parity and one stop bit. There is currently no flow control implemented, but
this can be configured here if so is wanted. Next the buffer size is set, and
an option for sofware flow control character setting is given.
53
5. Development
The READ RS232 from string subVI in Figure 5.9 shows how data is
read and controlled before parsing. If a time out occurs, which will happen
quite frequently since data comes asynchrounously, an error will occur. This
error is therefore cleared in the bottom right case, using a simple error
handler. The checksum control subVI checks if the received sentence has
the correct checksum, if not, an error message will appear on the front
panel. Next, provided the sentence has been received correctly, it will be
split in two messages, one providing the type of message, an the second the
message’s information.
The message type, and its information are so combined again, using a case
structure, placed in its indicator on the front panel, and at the same time
written to its global variable.
54
Software development
The Checksum control subVI in Figure 5.10 uses the checksum generator
subVI to calculate the checksum on the input sentence. This checksum
is then used as an input, to see if the input sentence contains the same
checksum. If it does not, an error is raised using the false case in the case
statement.
55
5. Development
The second while loop, shown in Figure 5.12, handles the transmission of
messages to the CS. The while loop contains a flat sequence structure with
three frames that execute sequentially. In the first frame the GS position
is transmitted, on the first call once engaged, and then only if it has been
recalculated. In the second frame the position correction message is trans-
mitted each second if the respective button on the front panel is pressed.
In the third and last frame the order message is generated with respect of
choises made from the Messages table on the front panel, and transmitted
if the Send order button is pressed. This message is the basis for which
messages one wants to receive from the CS.
The Check for new $GSPCO string subVI in Figure 5.13 compares the
sentence type and time information in two strings, giving a true output if
they are different. This is used to ensure that the position correction signal
is only sent once a second, ignoring that the position might change once in
between, due to the GPS receiving two different NMEA sentences.
56
Software development
The Send RS232 message subVI in Figure 5.14 transmits the input
sentence to the write buffer, on the serial port chosen by the VISA resource
name, provided its longer than six characters.
The $GSCTR generator subVI in Figure 5.15 uses the numbers in the
Messages array on the front panel to concatenate the $GSCTR string. Then
the checksum generator is used to calculate the strings checksum, concate-
nating it with carriage return and line feed constants making it a proper
sentence for transmission.
57
5. Development
58
Software development
GPS receiver VI
Figure 5.18 shows the complete GPS receiver VI’s block diagram. Figure
5.17 shows the main while loop. Before this is entered, the serial port is
configurated the same way as in the transceiver VI, only here with a data
rate of 9600 baud on COM7. In this main while loop the GS’s GPS receiver is
continously read, and its position is presented on the front panel. The while
loop also includes a case, where the error between the GS’s position and
the GPS recieved position is calculated. Before the GS position is calcuated
the error will be the received position. The calculation of the GS position is
performed in the while loop shown in Figure 5.22. The position is calculated
while the Calculate button on the front panel is pressed. When released,
the the calculated position is presented on the front panel, the global GS
Position Calculated variable is set, a $GPGGA NMEA-string is generated
and written to its global variable, $GPGGA-String, for transmission to the
CS.
Figure 5.17: Main GPS reciever while loop and position error calculation.
59
5. Development
60
Software development
The Read & format NMEA GPS subVI in Figure 5.19 gets the received
sentence type and data as an input. This is then fed to the Read GPS NMEA
subVI for parsing. Its output is then bundeled and fed to the GPS display.
Before the position is bundeled, it goes through the Decode & format position
string subVI to be recalculated to degrees, and gets added a degree sign.
The two latter VIs are documented in Appendix A.
61
5. Development
The “false” case in the main while loop, Figure 5.21, is active when the
GS position is calculated. This sets the position error to zero during the
calculation. It also controls the lights on the GS position display.
62
Software development
In the second while loop, Figure 5.22, the GS position calculation takes
place, in the Interpolate position subVI. When this is finished the $GPGGA
sentence will be generated, updating its display and global variables.
Figure 5.22: While loop for calculating and reporting the GS position.
63
5. Development
65
5. Development
Plotter VI
Figure 5.26 on the facing page shows the complete plotter VI block diagram.
The GS needs to be engaged before the plotter can be used. Before entering
the main while loop, shown in Figure 5.25, the map is drawn up, and the
GS position is drawn on top of the map. Then, inside the while loop, if a
navigation route is active, this will be drawn up. Next the CS plot will be
draw, either as a countinously plot, or just the last position, dependent on
the choice made on the front panel. If the GS position is recalculated the
Reset GS button must be pushed in order to draw up its new position on
the map. In order to plot the CS position, it has to be constantly updated.
This is done in the while loop shown in Figure 5.33 on page 72. In the same
while loop the distance between the CS and the GS is continously calculated
and presented in an indicator on the front panel.
The Draw map subVI in Figure 5.27 uses a case structure which provides
the map to be drawn up. Additional maps can be added in consecutive
cases. The map and the GS position plot is drawn up in three stages: The
GS position is formatted, the map is loaded and drawn up, and the GS plot
is drawn up. The GS position enters the case and are formated to the array
format for plotting. The maps are created by using publicly available airial
66
Software development
photos from gulesider.no. It was trimmed to 600 · 600 pixels and stored as
a bmp picture. The map is loaded and drawn up as a flattened pixmap.
The constants at the bottom of the figure defines the limits for the selected
map, latitudal and longitudal, in addition to the plot type and colour. These
limits were found using the interactive map Norgesglasset (Statens Kartverk
2007) for the map in question. The GS plot will then be plotted on top of
the loaded map, as a small red square, provided its within the map’s limits.
The Draw navigation plot subVI in Figure 5.28 takes an active naviga-
tion route and plots it on top of the map. The case shown is executed only
if the Plot route button on the front panel is pressed. The routes three way-
points are fed to the create plot subVI which formats it to the array needed
for plotting. The route is then plotted on top of the map, the waypoints as
small red squares with a red line between them. The route is also fed to the
$CSNAV generator subVI in order to generate the string for transmission
to the CS using the tranceiver front panel. For this the string are stored to
the global variable $CSNAV string and the Route planned global variable
are set to “true”. In the “false” case the Route planned global variable is set
to false and the $CSNAV string are cleared.
The $GSNAV generator subVI in Figure 5.29 takes the waypoint infor-
mation entered in the front panel and formats this to the defined $CSNAV
string.
68
Software development
69
5. Development
The Create array to plot subVI in Figure 5.30 changes the structure of
the array of plots. The input array only has one long row with latitude and
longitude coordinates. When entering the while loop, the two first values,
the first plot, are added as an initial value for the new array. Then, as the
while loop iterates, the two next values, the next plot, will be added in a
new row. When the whole input array is arranged the same way, the output
array will have as many rows as it has plots.
The GS & CS on map? subVI in Figure 5.31 takes the map limits, and
checks if the input GS and CS positions are within these limits. If it is, the
case structures “false” case will return an “OK...” message, if not the “true”
case will return a “Warning! GS/CS outside map area” message, which is
printed on the plotters status display on the front panel.
70
Software development
The Draw CS position plot subVI in Figure 5.32 uses a case structure
with two cases. On the plotter front panel one can chose if the CS position
is to be plotted continously or just plot the current position. The continous
plot case, in Figure 5.32a gets the map as an input, in addition to the CS
position, which is continously added to an array for plotting. This is then
fed to the create plot subVI and plotted on the map once a second. The
next case, in Figure 5.32b, takes the CS position and plots it directly on the
map once a second.
The Read & format $CSGPS subVI in Figure 5.34 get the $GSGPS
message as an input, its parsed in the read $CSGPS subVI and then for-
matted to be presented in the CS GPS diplay on the front panel.
71
5. Development
72
Software development
73
5. Development
IMU display VI
The IMU display block diagram in Figure 5.37 on the facing page, will when
started, wait and do nothing, until the GS is engaged. Then it will enter the
“true” case and read the global IMU string. Now, entering the while loop,
the IMU sentence is read from the global variable IMU string. It is compared
to the one read in the last interation of the loop, or in the first run, with
the sentence read before entering the while loop. The message are passed
through a shift register in the while loop. Only when a new message is read
will the IMU orientation data be parsed and the 3D model is drawn into the
display on the front panel. The CyberSwan 3D subVI contains a subVI that
generates the CS 3D model, draws it into the display on the front panel, and
rotates the model according to the roll, pitch and yaw angles read from the
$CSIMU sentence. The block diagrams for the CyberSwan 3D subVI and
CyberSwan 3D-model subVI were to big to be printed in this report, and
are available in Appendix A.
When the Reset display button on the front panel is pressed will the “true”
case in the case structure to the left in the while loop be active and reset the
display to its original setup, changing the orientation of the CS 3D model if
it has been rotated manually in the display. The “false” cases in this VI are
all empty.
The Read IMU data subVI in figure 5.36 reads the inputted $CSIMU
sentence and parses it into its respective variables for by the CyberSwan 3D
subVI and to be presented in the display on the front panel.
74
Software development
Sensor display
After the GS has been engaged, the sensor display VI continously reads
global variables (Figure 5.38) and presents the information on the front
panel. The information read are the last received message of the CS’s Servo
data, the Receiver data and the Other data, which holds the height mea-
surement from the ultrasound ranging device and the pitot tube airspeed
measurement.
Figures 5.39 to 5.41 shows the parsing of the received $CSSRV, $CSREC
and $CSOTH messages.
76
Software development
77
5. Development
CS simulator
Functional description
The program structure consist of one main program, the CS simulator VI,
which has the same structure as the GS VI. It loads the diffent VIs developed
into panels on its front panel. Chosing a tab in the top left corner of the front
panel (Figure 5.42 on the next page) changes the displayed VI. Here each
VI works individually, only shearing its simulated value with the tranceiver
VI for transmission. The passing of information between VIs are realised
using global variables.
The CS simulator concists of five panels:
• Transceiver
• IMU
• GPS
• Servo
In the next pages each of these VIs will be described. It is chosen to describe
the used subVIs with text only, with one exeption, where a figure also is used.
The complete documentation can be found in Appendix A.
78
Software development
79
5. Development
Transceiver
The transceiver VI block diagram (Figure 5.43 on the facing page) consists
of three while loops working in parallel. One for message reception, one to
read global variables, and one for message transmission.
The reception while loop reads incoming messages from the configured serial
port. The received messages are diplayed, and the $GSCTR message is
parsed. In the case of an error, this is diplayed in the Read status display.
The global variables updated in the IMU, GPS and servo VIs are read and
its respective display on the front panel are updated. The Receiver and
Other displays are not updated, and contains only a static value displayed
at the inital start of the VI.
In the transceiver while loop the transmission of messages takes place. The
acknowledge for the received navigational route message are sent when the
Send ACK button is pressed. The transmission of IMU, GPS, servo, receiver
and other messages takes place in five message slots placed in a stacked se-
quence structure. Dependent on the received $GSCTR message, will mes-
sages be assigned to be sent from these slots. Each slot contains a case
structure defining which message to send in this slot. The first case, 0, is
empty, meaning that no message are transmitted. The second case, 1, trans-
mits the IMU message, and so on. In between the slots are a delay, ensuring
that the message are transmitted before sending the next.
80
Software development
The read $GSCTR message subVI parses the received $GSCTR mes-
sage and writes it the msg ordered array.
The $CSNAV ACK subVI contains the acknowledge message that needs
to be returned in order to confirm that the $GSNAV message was received.
This acknowledge will always be the same, and is therefore hard coded to
$CSNAV,ACK*2C. It will be sent any time the Send ACK button is pressed.
81
5. Development
The assign messages to slot subVI in Figure 5.44 uses the received
$GSCTR message to assign which message are to be transmitted to the GS.
The alorithm in the MathScript node assigns transmission from four of the
slots, in an order decided by the q order array, here: 1,3,2,4. So if two
messages of the IMU type is ordered, these will be sent from slot 1 and 3.
The slots are assigned with a message priority decided by its place in the
$GSCTR message. The IMU message has the highest priority, and the other
message has the lowest. Ordering four messages of the IMU type, will then
only assign the IMU message to be transmitted. Since the four available
slots now are filled, any other ordered lower priority message will not be
sent.
82
Software development
IMU
The IMU simulator front panel in Figure 5.45 shows a 3D model of the CS.
It also has a display for the IMU data values, a Restart button, a button
to reset the 3D models perspective, the Reset display button. The source
for the 3D models motion are actual data collected from the IMU used in
the CS. A test program was developed to be able to collect the data to a
file. Then using this progam three files were collected adjusting the IMU
in roll, pitch and yaw direction. Each of these files can be chosen using
the Direction menu button on the front panel. The developed program is
available in Appendix A.
Figure 5.46 show the block diagram. First the inital perspective is arranged,
and then the chosen log file is read. The while loop iterates reading the table
row for row, drawing the 3D model, and rotates it respective to the read IMU
data’s roll, pitch and yaw angle. This read data is also written to a display
83
5. Development
on the front panel, and to a global variable, accessable for the tranceiver VI.
The CyberSwan 3D model generation and rotation subVIs are available in
Appendix A.
The Read IMU file subVI reads the chosen IMU log file and places the
data in an array.
The Read IMU data subVI reads one IMU message string from the
array, generated by the loaded IMU log file, indexed with the while loops
iteration number. The message is then parsed and diplayed.
The $CSIMU generator subVI reads the IMU display and generates the
$CSIMU sentence.
84
Software development
GPS
Figure 5.47 shows the GPS simulator’s front panel. The simulator circles
around an origin with a radius of approximately 250 meters. Then the
information defined by the $CSGPS sentence are gathered and written to
its display and the global variable accessable by the transceiver VI.
Figure 5.48 shows the VI’s block diagram. The inital GPS position are
first calculated in the Initial path subVI. Then a circular path is calculated
using the step 360◦ and CS path generator subVIs. This path is also plotted
in a display on the front panel. The simulated CS’s speed and course are
calculated in the Calculate GPS speed and course subVI. The calculated
values, along with a few constanst are then bundeled together and displayed
in the CS GPS display on the front panel. From these values the $CSGPS
string is generated with the $CSGPS generator.
85
5. Development
Servo
Figure 5.49 shows the Servo VI’s front panel, and Figure 5.50 shows its
block diagram. The servo values are generated by using random number
generators, giving them a value between 0 and 255. Then the $CSSRV
string is generated and displayed on the front panel, and written to the
global variable accessable by the transceiver VI.
87
5. Development
88
Software development
There are three ways to get a range measurement from the MaxBotix LV-
MaxSonar-EZ1. It has a pulse width output, analog voltage output and a
serial port. The sensor is to be connected to the I/O-card connected to the
CS’s main computer. Since this has a limited amount of serial ports, the
analog voltage option was taken.
The CS main computer system’s I/O-card features an Atmel ATmega128
microcontroller (Bjørntvedt 2006). A routine to get a range measurement
was programmed in C, using a built in analog-to-digital converter (ADC) to
sample the analog voltage, representing the measured range. A test program,
running the programmed range-routine once a second, was developed using
the Atmel STK500 development board, with the STK501 add-on card which
features the ATmega128. It was programmed with Programmers Notepad,
provided with the WinAVR (2006)-package.
The test-program is enclosed in Appendix A.
89
Chapter 6
Results
Test setup
Figure 6.1 shows the HIL test setup, consisting of the following hardware:
• Dell Inspiron Laptop Centrino 1.4 GHz with 512 MB of memory run-
ning the GS software
91
6. Results
Objective
The objective of the tests was to find the GS performance with regards of
communication for presentation of data and navigation.
Test description
The following tests were performed:
92
HIL test
Each test, exept test 4, were performed for three minutes and repeated three
times. The results are given with a percentage of how many messages that
were lost.
Test 1
Test 2
93
6. Results
Test 3
The results from test 3, simultaneous performance of test 1 and 2, are shown
in Table 6.3. Run four is a reference test using a null modem cable.
Test 4
94
Video test
Video from the wireless camera, fixed on the CS’s tail, was recorded in-
flight while performing tests on the CS’s controllers. Figure 6.2 shows the
antenna used for receiving and the video camera used for recording. The
video, edited by Høstmark (2007), is enclosed in Appendix A.
95
Chapter 7
Discussion
This chapter is divided into four parts. First the results from the HIL tests
are discussed. Further, the hardware choices, the software choice and system
design are evaluated. At last are some recommendations for further work.
7.1 Results
97
7. Discussion
100 ms from before. Now all the sentences were received without any faults,
but this just created a new fault as the GPS receiver became slower. Quite
some time was spent examining the properties of the serial ports, and why
they would influence each other, but no definitive reason was found. It was
not pursued further, since the problem was discovered in a late stage of the
project.
In test 3 multiple collisions were expected, due to no flow control, and trans-
mission in both directions. Still, also here the faults were confined to the
reception of the $CSGPS sentence. The interesting property here is that, in
run 4, with the null modem cable, the result were perfect both ways. When
the GS transceiver was both sending and receiving, the reception buffer
problem from test 2 was removed. The problem were not found, but the re-
sults pointed to that resources were spent somewhere in the block diagram
during reception only, slowing it down.
Test 4 resulted in a 4 Hz throughput, tested with the IMU sentence. The
IMU display managed to follow the CS simulator’s IMU display, only lagging
behind due to the transmission latency.
It was, after reviewing these tests, that the RF link could be a successful
implementation when connected to the CS computer system. But before
this, the receiver problem in the GS’s transciever would have to be adressed.
In addition should hardware flow control concidered to be implemented.
The hardware selection applies to the GPS receiver, the RF receiver, the
wireless camera and the ultrasound ranger.
The GPS receiver had all the properties one would want, and have not
posed any particular problems. The only complaint would be the poor doc-
umentation. The development of the circuit board progressed without any
problems.
The ultrasound ranger was not tested during a landing situation, where it
would be used in a autonomous mode. The CS’s computer system was not
finished in order for the ranger to be implemented on the I/O board. Still,
the ranger was manually tested on a surface similar to a landing site, giving
a clear range reading of at least 2.5 m. This gave an indication that the
ranger could be used in an autonomous landing mode.
98
Software choice and system design
Concidering that the camera that was chosen, the Luda Minikameran, are
made for home security, its quality of video are acceptable. Still, it is not
close to the quality seen in Hi Cam’s Pro X2 system example videos. This
system have superior resolution and a noise free picture, while Minikameran’s
image are easily distorted. The Pro X2 also enables any video source to be
connected. But since this system was unavailable Minikameran was the next
best choice, and delivered unique in-flight images from the CS.
The RF receiver was chosen based on a few criteria: range, current con-
sumption and data rate. The data rate was thought of beeing a little low,
but the range was given priority, and the Radiocrafts RC1240 was therefore
chosen. The development of the circuit board went well, exept an erroneous
footprint, which was corrected using one short wire. The choice of commu-
nication device was not appraised to be an especially good choice during the
project period, because of problems with errors and low throughput. Some
problems with the configurations were discovered and corrected. And in the
end, achieving 4 Hz with the IMU message was more than expected on a
4800 baud connection. It was also experimented with flow control, though
not sucessfully implemented. Chosing RC1240 as the communication device
was eventually proven to be a good one. Still, a higher data rate would be
needed if there is a need to transfer data like IMU, servo information and
height, at a higher combined rate than 4 Hz. Then the MaxStream modems,
used by the Aerobotics Reaserch Group at Monash University (2007), could
be investigated. A higher data rate would also be necessary if it is of interest
to transfer other data, like digital photos, through the same communication
device.
99
7. Discussion
The recommendations for further work can be divided into two categories:
improvements to the developed system and additional work.
The developed system works but the communication lacks flow control. This
is available in the chosen communication link, and the serial configuration in
the software is equipped with this option. In order to implement this in the
software, the transceivers structure should be evaluated and perhaps restruc-
tured. The problem regarding message reception should also be adressed.
The developed plotter has a few limitations. New maps have to be manually
100
Recommendations for further work
developed, the plots and lines are difficult to see due to their size, and the
current design does not support the crossing of datum lines. The plotter
works, but is not concidered to be versatile. It is recommended to research
for a third party plotter capable of implementation with the rest of the GS
software.
Currently only the navigation route message demands an acknowledge, this
should also be implemented for the GS position transmission. Implementa-
tion can be done in the same manner as the navigation route transmission
structure, sent only when the GS is not engaged. It should be concidered
if this is necessary for the Order message, as one can see what message is
beeing received, and thereby can conclude if the message transmitted to the
CS was received or not.
101
Chapter 8
Conclusion
The main objective in this thesis has been to develope a ground station
(GS) for the CyberSwan (CS) fixed-wing UAV. In addition a CS simulator
has been developed, in order to test the GS, due to unavailability of the
real system. Two electronic circuits has been developed: a RF card for
communication between the CS and the GS, and a GPS receiver board.
Supporting equipment for the CS has also been collected: a wireless camera
system and a ultrasonic ranging device.
Video have been transferred from a test flight, with acceptable quality. The
GS and the CS simulator were developed in LabVIEW. A hardware in the
loop (HIL) test was performed using these systems. The HIL test brought
a reception problem in the GS to the surface. It was discovered that the
timeout setting in the configuration of the two serial devices connected to
the GS influenced each other, causing a loss of 5 % of the messages on the
communication device. Transmission was not affected by this problem, nor
was the CS simulator. It was not possible to solve this problem before the
deadline.
Beyond the mentionded problem, the tests proved that the selected com-
munication device has a data rate high enough for the intended use. A
throughput of 4 Hz was successfully achieved, making it possible to follow
the CS’s state through the GS.
103
Appendix A
DVD
A.1 Contents
105
DVD
A.2 DVD
107
Bibliography
Baykar Machine Inc (2007), ‘Bayraktar mini uav system’, web page:
www.baykarmakina.com.
Deitel, H. M. & Deitel, P. (2001), C++ How to Program, 3rd edn, Prentice
Hall.
109
Bibliography
Green Bay Professional Packet Radio (2007), ‘Microstripline Analysis & De-
sign’, web page: http://my.athenet.net/˜ multiplx/cgi-bin/strip.main.cgi.
Wormley, S. (2007), ‘Gps errors & estimating your receiver’s accuracy’, web
page: edu-observatory.org/gps/gps accuracy.html .
110