1.2 Scope and ObjectivesThese researched questions were devised to guide the course of the project: • Learn how USV work on Ardupilot • Connect USV with GCS via Companion Computer Raspbe
Trang 1Vietnam National University Ho Chi Minh City
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering
——————– * ———————
Graduation Thesis
Building an Unmanned Surface Vehicle (USV) for
wet land monitoring
Committee : Computer Engineering
Supervisor : Pham Quoc Cuong, Assoc Prof
Nguyen Cao Tri, M.Eng
Reviewer : Pham Hoang Anh, Ph.D
Student : Le Xuan Nguyen - 1752384
Ho Chi Minh City, June 2022
Trang 2FL012 TRƯỜNG ĐẠI HỌC BÁCH KHOA
KHOA KH & KT MÁY TÍNH
CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM
Độc Lập – Tự Do – Hạnh Phúc
Số: /ĐHBK-
Bộ môn: NHIỆM VỤ LUẬN VĂN TỐT NGHIỆP
(Chú ý: sinh viên phải dán tờ này vào trang thứ nhất của bản thuyết minh)
HỌ VÀ TÊN: Lê Xuân Nguyên MSSV: 1752384
NGÀNH: KỸ THUẬT MÁY TÍNH LỚP: CC18KTM1
1 Đầu đề luận văn: Building an Unmanned Surface Vehicle (USV) for wet land
monitoring based on Ardupilot platform
Số liệu:
- Phần mềm Open source Adrucopter
- Website Adrupilot
2 Nhiệm vụ:
- Tìm hiểu protocol Mavlink trong hệ phầ mêm Adrucopter
- Xây dựng mô hình kết nối giữa Contorller boảd Adrucopter với hệ phần mêm Ground station phục vụ cho các yêu cầu điều khiển tự động cấp cao qua giao tiếp Mavlink phục vụ cho các ứng dụng quan trắc moi trường đất ngâp nước bằng tàu tự hành
- Hiện thực và thử nghiệp kết nối và điều khiển qua Mavlink
3 Ngày giao nhiệm vụ luận văn: 30/05/2022
4 Ngày hoàn thành nhiệm vụ: 30/09/2022
- ThS Nguyễn Cao Trí Bộ Môn Công Nghệ Phần Mềm 100%
PHẦN DÀNH CHO KHOA, BỘ MÔN
Người duyệt (chấm sơ bộ):
Trang 5We assure that except for the results from the references of other relevantworks, the content presented in this thesis is our own implementation and has notbeen submitted in whole or in part, to consider for any degree in school, or anyother university
Trang 6First of all, we would like to express our sincere gratitude to our advisors,M.S Nguyen Cao Tri and Assoc Prof Pham Quoc Cuong for their enthusiasm andpatience They have also given us excellent supervision and guidance which havehelped us tremendously at all times during our research We could not imaginehaving better advisors for our study
We also wish to express our thanks to the Ho Chi Minh University ofTechnology and to the Computer Science and Engineering faculty for the preciousknowledge and experience that we have gained here
i
Trang 7The objectives of thesis is to delve into a design of a autonomous vehiclefor the wetland monitoring In the effort to design a more repeatable and consistentplatform to collect data for Structure from Motion (SfM) monitoring of coral reefsand other benthic habitats, we explore the use of recent advances in open sourceGlobal Positioning System (GPS)-guided drone technology to design and test alow-cost and transportable small unmanned surface vehicle (sUSV) The vehicleoperates using Ardupilot open source software and can be used by local scientistsand marine managers to map and monitor marine environments in shallow areas(<20 m) with commensurate visibility
Trang 81.1 Overview 1
1.1.1 Purpose of the projects 1
1.1.2 General overview and motivations 1
1.2 Scope and Objectives 3
1.3 Thesis proposal report structure 4
2 Related Work 5 2.1 Overview 5
2.2 Kenterprise Self-driving Boats 9
2.3 Comparison to our thesis 10
3 Background 12 3.1 Background 12
3.2 Unmanned Surface Vehicles 12
3.2.1 Elements of USV 13
3.2.2 Relationship between USV subsystems 14
4 Proposed Approach 16 4.1 System Design 16
iii
Trang 94.1.1 Original System 16
4.1.2 What is the problem ? 17
4.1.3 System Overview 18
4.1.4 Module Structure of ArduPilot 20
4.2 Component 21
4.2.1 Communication Layer 21
4.2.2 Driving code 29
4.2.3 Hardware 35
4.2.4 Software 39
4.3 Implement 43
4.3.1 Wiring Diagram for USV 43
4.3.2 Set up environment for Raspberry Pi 46
4.3.3 H743-SLIM 49
4.3.4 Connect Mission Planner with H743-SLIM via Raspberry Pi 55 4.3.5 Handle Radio control 59
4.3.6 New Ground Control Station 64
5 Conclusion And Future Work 67 5.1 Conclusion 67
5.2 Future Work 68
Trang 10List of Figures
3.1 USV architecture 14
3.2 General structure of USV 15
4.1 Simple Overview of ArduPilot Operation 16
4.2 Basic system for ArduPilot USV 17
4.3 Overview system 18
4.4 Overview system with more detail 19
4.5 Module structure model for ArduPilot 20
4.6 Message Format 23
4.7 High Level Message Flow 24
4.8 Heart beat message 25
4.9 Status message 26
4.10 COMMAND-LONG message 26
4.11 Long Running Commands Sequences 27
4.12 The home directory of the source code 34
4.13 Raspberry Pi 36
4.14 Raspberry Pi 37
4.15 Mateksys H743-SLIM 37
4.16 STM32F103C8T6 38
4.17 SITL(Software in the loop) 40
4.18 SITL Architecture 41
4.19 DroneKit Python 42
v
Trang 11List of Figures
4.20 Mission Planner User Interface 42
4.21 Wiring Diagrams General 43
4.22 H743-SLIM connects with Raspberry Pi 44
4.23 H743-SLIM connects with GPS module 45
4.24 H743-SLIM connect with ESC and servo 45
4.25 Companion Computer Diagrams 46
4.26 SPI and I2C are enable 47
4.27 Serial is enable 47
4.28 STM32 Cube Programing 49
4.29 ImpulseRC-Drivder-Fixer.exe 49
4.30 Detect serial Port connecting 50
4.31 Erasing H473-SLIM memory 50
4.32 Firmware for H743-SLIM 51
4.33 Install Firmware for H743-SLIM 51
4.34 Connect H743-Slim to mission planner success 52
4.35 Firmware for H743-SLIM 53
4.36 ARMING CHECK setting 54
4.37 Disable Plane Failsafe 54
4.38 Raspberry Pi connect with H743-SLIM 55
4.39 Raspberry Pi connect with H743-SLIM 56
4.40 Mission Planner connect with H743-SLIM via Raspberry Pi 57
4.41 Connect H743-Slim to Mission Planner success via Raspberry Pi 58 4.42 Attitude parameter 58
4.43 Radio control communicate with PC(Ground Control Station) 59
4.44 Sbus inverted signals 60
4.45 Inverting amplifier 60
4.46 Un-inverted board diagram 61
4.47 Un-inverted board 61
Trang 12List of Figures
4.49 Un-inverted board 62
4.50 Radio controller to PC success 63
4.51 Web app diagram 64
4.52 Heartbeat from H743-SLIM 65
4.53 Video feed 65
4.54 Video feed 66
4.55 System status 66
4.56 GCS web app 66
vii
Trang 13MAVLink Micro Air Vehicle Communication Protocol
RMS Root Mean Square
SLAM Simultaneous Localization And Mapping
GSC Ground Station Control
Trang 141 Introduction
1.1.1 Purpose of the projects
Unmanned and remote-controlled vessels is a hotly debated issue today
In a time where counterfeit insight is nearer to reality than any time in recentmemory, no big surprise individuals trust that this is the subsequent stage in theimprovement of marine innovation There are now automated elevated vehicles andself-driving vehicles yet there are no automated vessels There are so many uniquepotential outcomes in executing this sort of innovation and nobody knows without
a doubt what the future will hold Regardless of how interesting or cool newadvances are, there is generally the topic of need New innovation needs to supplantyet more significantly develop whatever was previously and this is additionally thesituation with independence An independent vessel doesn’t fundamentally should
be totally constrained by a PC, there are alternate methods of executing it
1.1.2 General overview and motivations
1.1.2.1 Overview
The Unmanned Surface Vehicles (USV) or Autonomous Surface Vehicles(ASV) are vessels that operates on the water surface without any crew Theyare remotely controlled and can be controlled by an operator located on land
or on board of another vessel Thereby performing inspections of other ships,etc while manned boats are kept at a safe distance, avoiding unnecessary risks.Moreover USV are usually resistant, stable, stealthy, fast so they are able to work
1
Trang 15be solve autonomously, frequently and more accuracy For example, a stationary,submerged water monitoring device called the Environmental Sample Processorwas introduced in 2009 Another monitoring device is the AutoNaut AutomatedSea Vehicle, an autonomous boat that harvests energy from solar power and thenatural pitching and rolling of the sea It communicates with satellites for receivinginstructions and for sending the data it gathers While many projects and deviceshas been introduced and applies in some areas, the existing platforms are tooexpensive and too large for individual and in real life applications Moreover, theplatforms still depend on device and component, which can’t be easily to customizeand replace in different situations Therefore , we propose a new platform, whichbase on open source fully, low-cost and easily to monitoring wet land quality inreal life.
Trang 161.2 Scope and Objectives
These researched questions were devised to guide the course of the project:
• Learn how USV work on Ardupilot
• Connect USV with GCS via Companion Computer (Raspberry Pi)
• Connect the RC controller to GCS
• Control the USV with RC
• Merge there signals: RC, datalink and video streaming (IO Camera) into 1connection method (UDP)
• How can we collect and analyze data from sensor in checkpoint and sendthem to the ground stations?
3
Trang 171.3 Thesis proposal report structure
From the goals of our proposal, we decide to develop our thesis into contents:
• Chapter 1: We will give a short brief about our thesis and show somedevelopment of similar projects in the world
• Chapter 2: We conduct some survey and have them compare with our project
• Chapter 3: In this chapter, we decide to show some background knowledgeabout the USV, which platform we use for thesis
• Chapter 4: How we are going to design our system and what we use to designand build our project
• Chapter 5: What we have done so far and the results we got
• Chapter 6: In the last chapter, we will discuss about our plan for the futurealso the work division table for the other part
Trang 182 Related Work
With the growing in business, logical, and military purposes on both oceansand shallow water There is a trend of developing unmanned surface vehicleswith advanced guidance, navigation and control capabilities Despite this, partlyautonomous USVs are more popular than fully-autonomous USVs, due to numerousdifficulties in creating and implementing an efficient and reliable hardware forserving different missions and facing with critical environment Furthermore,developing a full autonomous USVs need to minimize both the human interactionand the USVs operations
USVs always compete with another types of autonomous vehicles andsystems in some scientific aspects This tables 2.1 show short brief of these systems
In the just two decade, there are numerous institutions, universities, businessesand militaries begun developing USVs for various applications
5
Trang 192.1 Overview
Types Specific Applications
Scientific
research Bathymetric survey (Roberts and Sutton, 2006); ocean
biologi-cal phenomena, and migration and changes in major ecosystems(Goudey et al.,1998);ocean activities research; multi-vehicle coop-eration (cooperative work among aerial, ground, water surface orunderwater vehicles)(Yan et al., 2010; Majohr and Buch,2006);
as experimental platforms for the purpose of testing hull designs,communication and sensor equipments, propulsion and operatingsystems, as well as control schemes (Breivik, 2010; Vaneck et al.,1996)
Environmental
missions Environmental monitoring, samplings, and assessment (Caccia etal., 2005; Rasal,2013; Naeem et al., 2008b; Svec et al.,2014b);
disas-ter(like tsunami, hurricane, eruption of submarine volcano) aidedprediction and management, and emergency response (Murphy etal.,2008); pollution measurements and clean-up
Ocean resource
exploration Oil, gas and mine explorations (Roberts and Sutton, 2006; Pastoreand Djapic,2010); offshore platform/pipeline construction and
main-tenance (Bertram, 2008; Breivik et al., 2008)Military uses Port,harbor, and coastal surveillance, reconnaissance and patrolling
(Kucik, 2004; Caccia et al., 2007; Pastore and Djapic,2010; Svecand Gupta, 2012); search and rescue (Roberts and Sutton.2006;Murphy et al., 2008); anti -terrorism/force protection (Campbell
et al., 2012); mine countermeasures (Navy, 2007); remote weaponsplatform (Bertram, 2008); target drone boats (Roberts and Sutton2006)
Other
applications Transportation (Kiencke et al., 2006); mobile communication relays
(Caccia et al., 2008a); refueling platform for USVs, unmanned aerialvehicles(UAVs), unmanned under-water vehicles(UUVs), and othermanned vehicles
Trang 201996 ACES (Manley, 1997) 1) Oceanographic data collection
1998 SCOUT (Goudey et al., 1998) 1) Cooperative control;2) Testbed1990s Roboski (Bremer et al., 2007) 1) Surveillance; 2) Target drones1990s Owls USVs (Motwani, 2012) 1) Harbor and ship security
2000 AutoCat (Manley et al., 2000) 1) Survey of shipwreck
2001 Spartan Scout (Motwani, 2012) 1) Port surveillance; 2) Force
2005 Seadoo Challenger 2000 (Ebken et
al., 2005) 1) Collision avoidance; 2) Au-tonomous recovery
2005 HUSCy (Curcio et al., 2005) 1) Hydrographic survey
2008 Wave Glider (Bingham et al.,
2010 Piranha (Yang et al., 2011) 1) Reconnaissance
2011 MUSCL (Bertram, 2008) 1) Surveillance and reconnaissance
UK
1990s MIMIR (Roberts and Sutton,
2000s C-series USVs (Anonymous,
2014a) 1) Assets security; 2) Environmen-tal monitoring; 3) Mining2000s FENRIR (Roberts and Sutton,
2006) 1) Relay between UUV and con-trol center2000s Sentry (Murray, 2008) 1) Harbor and shore survey and
protection
2003 SWIMS (Roberts and Sutton,
2003 SeaFox (Yakimenko and
Kragelund, 2011) 1) Maritime security operations
2004 Springer (Naeem et al., 2008) 1) Environment monitoring; 2)
Trang 212.1 Overview
Italy
2004 SESAMO (Caccia et al., 2005) 1) Environmental sampling
2005 Charlie (Caccia et al., 2007) 1) Environmental sampling and
2004 DELFIM (Alves et al., 2006)and
DELFIMX (Gomes et al., 2006) 1) Oceanographic sampling; 2)Communication with UUVs
2006 ROAZI and II (Martins et al.,
2006 Swordfish (Ferreira et al., 2007) 1) Environmental surveyNorway 2008 Kaasbøll (Breivik et al., 2008) 1) Navigation and control systemstest
2008 Viknes (Breivik, 2010) 1) Multi-purpose system tests2000s Mariner (Breivik, 2010) 1) Environmental surveillance and
France 20052005 Basil (Bertram, 2008)MiniVAMP (Bertram, 2008) 1) Offshore pipelines survey1) Remote survey of offshore
pipelines
2007 Inspector (Yang et al., 2011) 1) Surveillance and reconnaissanceSweden 2002 Piraya (Yang et al., 2011) 1) Cooperative control
Singapore 2010 Venus (Bertram, 2008) 1) Multi-tasks test
China 20082010 Tianxiang One (Yan et al., 2010) 1) Meteorological surveySV-Zheng He (Yang et al., 2011) 1) Inshore marine data collectionJapan 20002004 Kan-Chan (Desa et al., 2007)UMV series (Bertram, 2008) 1) Study of global warming1) Ocean and atmosphere explo-
rationIndia 2006 ROSS (Desa et al., 2007) 1) Oceanographic sampling
Trang 222.2 Kenterprise Self-driving Boats
In 2020, there is a projects which create a unmanned boat for discover,water monitoring and reproduce water in a lakes The purpose of the boat was
to regularly sweep the surface of the lake and measure the algae concentration.Then the collected data can be printed to a heat map to understand under whichcircumstances algae starts do build up and also to issue real time warnings to localsand tourists This projects include several steps for creating fully-autonomousboat:
1 Creating the Hull
They create a detailed 3D model of a catamaran in Fusion 360 They giveeach component of the hull a specific weight and even modeled the interior
in order to control the center of the ship, avoided tilting to one side and keptthe boat balanced when moving on real environment
2 Creating Propulsion System and Steering
For this part, they used 2 racing boat motor for powering a one meter longboat and the corresponding electronic speed controller (ESC) can deliver90A continuously The motor shaft is connected to the prop through twouniversal joints, an axel and a so called stern tube, that is meant to keep thewater out
For the direction controller, they choose to use thrust solution instead ofrudders modeled a thrust assembly in Fusion and 3D printed the thrust,hinges and a servo mount For the servos they choose two 25kg Servos tomake sure the boat able to withstand the drag of the water.With differentialthrust, the two motors turn in the opposite direction to make the vehicle turn
As the boat is almost as wide as it is short and the motors are positioned faraway from the center this allows turning on the spot
3 Building the brain of the boat
Based on the model of common FPV drones, they design a box contained all
of electronic modules Power Distribution Board implies and distributes thepower Two wires from the battery come in and it offers multiple solder pads
to connect different modules to the battery This components can provide 5vand 12v supplements The flight controller use Omnibus F4 V3S running theArduPilot Rover Firmware.It controls the motor controllers through severalPWM Outputs, it monitors the battery voltage and current, it connects to thedifferent sensors and input and output devices and it also features a gyroscope
9
Trang 232.3 Comparison to our thesis
For the RC receiver, the boat uses FlySky remote for RC planes that has tenchannels and even establishes two way communication so the remote can alsoreceive signals from the receiver.The 433MHz antenna belongs to a telemetrymodule This little transmitter is an input/output device that connects theflight controller to the ground station (a laptop with a 433MHz USB dongle).This connection allows the operator to remotely change parameters and getdata from the internal and external sensors This link can also be used toremotely control the boat The last component in this box is M8N GPS andcompass module This is what enables the boat to know it’s position, speedand orientation
4 ArduPilot Setup
There are basically the following steps to get an ArduPilot Rover up andrunning after everything is wired up correctly:
(a) Flash ArduPilot Firmware to FC
(b) Install a Ground Station software like Mission Planner and connect theboard
(c) Do a basic hardware setup
(d) Do more advanced setup by going through the parameter list
(e) Do a test drive and tune the parameters for throttle and steering
After creating part, they decided to create some simple mission for testingthe performance of the boats The boat was able to follow simple routes and sends
a constant stream of telemetry data to the ground station It also collect theywater data of heat, harmful toxic concentration and so on This can make userhave a clear view about the water condition and have a solution for reproduce thewater
Nowadays, there are several different autopilot solutions on the market.There are sophisticated commercial autopilots but more expensive than opensource solutions Although open source autopilots can not achieve the performance
of some commercial autopilots, they provide great flexibility both in the hardwareand software, as the users can modify the autopilot based on their own requirements.These autopilots are also a good option for small budget projects
Trang 242.3 Comparison to our thesis
After researching and comparing to many recent USV projects, there aresome main different when compared to our thesis Most of USVs usually usesexist FC component in the market which increase the cost and lower the ability toreplace or add new sensor to the FC It makes user to depend on the hardwaresupported for ardupilot only Instead of that, the life cycle and the support forthese component is also a serious problem A normal FC support only for ardupilotcan operate normally for three or four years, which make user have to replace thenew component for their systm to continuing operate The environment or humaneffects can damage or destroy some sensor or components in the FC So, in ourthesis, we decide to use another hardware components, which can operate well withthe ardupilot platform but not using or depending on ardupilot hardware Also,
we want to implement a system which allow users add or remove sensors easilywithout cost or damage to the main components This will make the new FC moreconvenient and reliable for different purposes or missions
11
Trang 253 Background
With the growing in business, logical, and military purposes on both oceansand shallow water There is a trend of developing unmanned surface vehicleswith advanced guidance, navigation and control capabilities Despite this, partlyautonomous USVs are more popular than fully-autonomous USVs, due to numerousdifficulties in creating and implementing an efficient and reliable hardware forserving different missions and facing with critical environment Furthermore,developing a full autonomous USVs need to minimize both the human interactionand the USVs operations
USVs always compete with another types of autonomous vehicles andsystems in some scientific aspects This tables 2.1 show short brief of these systems
In the just two decade, there are numerous institutions, universities, businessesand militaries begun developing USVs for various applications
Unmanned Surface Vehicles, or USVs, are surface vehicles which can operatewithout any crews or pilots, being remotely controlled by a Ground Control Station(GCS) An Unmanned Surface System includes all the required elements, technologyand network to control and communicate with the USV is known as a UnmannedSurface System (UAS) Thereby maintaining a first line of defense or performinspections of other ships, etc while manned boats are kept at a safe distance,avoiding unnecessary risks
Trang 263.2 Unmanned Surface Vehicles
3.2.1 Elements of USV
There are many different characteristics and application, USVs may come
in a variety of functionalities and appearances However, a USVs must containthese following basic elements (see in figure 5.1):
• Hull and auxiliary structural elements:
Based on materials, hull can be divided into 4 main groups: rigid inflatablehulls, kayaks, catamarans and trimarans Each hull’ group has specific missionand application in USVs development For example, rigid inflatable hull isusually used for military because of their significant payload capacity andendurance Kayaks and catamarans have known as a great mounting andloading boat The trimarans USVs in often found in trip with rough water
• Driving and power system:
Most of USVs use rudder and propeller propulsion systems for heading andspeed control Some of USVs are directed by two independent motor or waterjet in both side of the vessels
• Guidance, Navigation and Control system (GNC):
A GNC system on USVs is built with onboard computer, sensor and softwarewhich is compliment each other in order to manage and control the wholeUSV system
• Communication system:
Communication system can combined onboard wired or wireless cation with variety of sensors, antenna and other equipment A strong andreliable communication system is along these lines of foremost significance
communi-• Data collection system:
Gyroscope and GPs along with above component can ensure the operatingprocess and improve its performance Some other part such as cameras, radar,sonar and a number of sensors will be install optionally depended on the tasksuch as water monitoring, military operation,
• Ground Control System:
A Ground Control Stations (GCS) are sets of ground-based hardware andsoftware that allow USV operators to communicate with and control a vehicleand its payloads, either by setting parameters for autonomous operation or
13
Trang 273.2 Unmanned Surface Vehicles
by allowing direct control of the USV A GCS can based on a processingunit such as computer, laptop or bespoke system based on an embeddedcomputing platform The USV can communicate remotely with GCS through
a wireless data-link subsystem Telemetry data, commands, and sensor datasuch as video, images and measurements may all need to be transferredbetween the USV and the GCS Control systems built into the GCS mayinclude joysticks for aircraft and/or payload, throttle controllers, as well askeyboard and mouse
3.2.2 Relationship between USV subsystems
All fundamental elements combine together and create 3 main subsystemsfor the USVs: guidance, navigation and control subsystems These subsystemsupport each other to maintain the performance of the vessels
1 Guidance system is responded for continuously tracking, creating and dating optimal trajectory from the information and data from navigationsystem, mission reception and engagement system, vessel and environmentalconditions
up-2 Navigation system concentrates on the current and incoming situation andcondition, based on the past and current states of the USVs and the environ-
Trang 283.2 Unmanned Surface Vehicles
3 Control system focuses on controlling forces and moments for conjunctioninstruction provided by guidance and navigation systems
15
Trang 304.1 System Design
The basic goal of the software is to provide control of the vehicle, eitherautonomously, or via pilot input through radio control transmitter or groundcontrol station, or via companion computer on board the vehicle, any of whichare optional, including only loading a fully autonomous mission on the vehicle forexecution
Control inputs are input either by radio control receiver, or via MAVLinkcommunication from telemetry or companion computers The radio control receiverprovides Roll/Pitch/Yaw inputs for desired attitude control, vehicle power (throttle),
as well as control of operational modes and auxiliary functions
Outputs are provided to activate servos, motors, relays, etc to control thevehicle Also, attitude, position, power system monitoring, and vehicle speed areprovided by sensor inputs to the autopilot
The system include two main components which are the USV and GroundControl Station These two components are allowed to communicate with eachother through Communication Layer
4.1.2 What is the problem ?
In the above system, we can clearly see that the communication and control
of the USV needs different communication methods, not to mention the usual livestreaming video needs a new transmission line Therefore, turning all channels into
1 including live streaming video will be implemented in this thesis
17
Trang 314.1 System Design
4.1.3 System Overview
In this new system, all Radio control, Live streaming video, Data (GPS,compass, ,) signals will be communicated between USV and Ground ControlStation via only one communication method
• In GCS module, Radio control now is connected directly to Ground ControlStation, which means Ground Station can control the USV by two way: handcontrol and autonomous control GCS will send these control signals to USVand receives other signals from USV (video and data)
• Controller and companion computer are two smaller modules in USV panion computer now act like a telemetry device and still being a companioncomputer It collects the control signals from GCS to send to Driver control,receive position data from Driver control and process the video to send back
Com-to GCS
• Drive control have the mission to control servos,motors base on control signalsrecieved from Companion computer and send the position data to Companion
Trang 324.1 System Design
19
Trang 334.1 System Design
4.1.4 Module Structure of ArduPilot
Trang 344.2 Component
ArduPilot’s three layers can be seen in this structure, while communication(with MAVLink) and user interfacing (with Ground Station) can be seen as twoother layers above it
• Ground Station module: As a supported external software for ArduPilot,Ground Station runs on a ground-based computer, and communicates with
an unmanned aerial vehicle (UAV) It displays real-time data on the UAV,and can be used for controlling it
• MAVLink: An external software used by ArduPilot with its own protocolsfor communication with ground stations / companion computers
• Vehicles code: The vehicle directories are the top level directories that definethe firmware for each vehicle type
• Shared libraries : The code usable by multiple vehicles including core, sensors,and other libraries for various functions: control, navigation, etc
• Hardware abstractions layer: Renders ArduPilot portable to many differentplatforms and development boards
4.2.1 Communication Layer
4.2.1.1 Ground Station Control
Ground Station Software: Several ground control applications are availablefor the most common operating systems (Windows, Linux, Mac OS X, Androidand iOS) Some of them are open source and some have proprietary licenses.For personal computers there are, for example, Mission Planner, APM Planner2.0, MAVProxy, UgCS and QGroundControl For mobile devices there areTower, AndroPilot, MAV Pilot 1.4, SidePilot and QGroundControl (mobile version)
All of them offer more or less the same functionality—firmware programming
in the flight controller board, configuration of vehicle parameters, sensor calibration,
RC system configuration and calibration, telemetry monitoring, flight modemanagement, 3D waypoint navigation and mission control, vehicle global positionvisualization on a map, FPV video monitoring, and others
21
Trang 354.2 Component
In general, all can be used with flight controller hardware and firmwarefrom Ardupilot because all of them use the MAVLink protocol to communicatewith vehicles, to send commands and receive telemetry and parameter data.However, in our project we will only working on mission planner Mission Planner
is compatible with Windows only Mission Planner can be used as a configurationutility or as a dynamic control supplement for your autonomous vehicle Here arejust a few things you can do with Mission Planner:
• Load the firmware (the software) into the autopilot board (i.e Pixhawkseries) that controls your vehicle
• Setup, configure, and tune your vehicle for optimum performance
• Plan, save and load autonomous missions into you autopilot with simplepoint-and-click way-point entry on Google or other maps
• Download and analyze mission logs created by your autopilot
• Interface with a PC flight simulator to create a full hardware-in-the-loopUSV simulator
• With appropriate telemetry hardware you can:
– Monitor your vehicle’s status while in operation
– Record telemetry logs which contain much more information the theon-board autopilot logs
– View and analyze the telemetry logs
– Operate your vehicle in FPV (first person view)
Trang 364.2 Component
• The messages are not guaranteed to be delivered which means ground stations
or companion computers must often check the state of the vehicle to determine
if a command has been executed
Message Format
• The sender always fills in the System ID and Component ID fields so thatthe receiver knows where the packet came from The System ID is a unique
ID for each vehicle or ground station Ground stations normally use a highsystem id like “255” and vehicles default to use “1” (this can be changed
by setting the SYSID_THISMAV parameter) The Component ID for theground station or flight controller is normally “1” Other MAVLink capabledevice on the vehicle (i.e companion computer, gimbals) should use thesame System ID as the flight controller but use a different Component ID
• The Message ID field can be seen in the common.xml and ardupilot.xml next
to the message name For example the HEARTBEAT message Id is “0”
• The Data portion of the message holds the individual field values being sent
23
Trang 374.2 Component
• Once a connection is opened each device (aka “System”) sends the BEAT message at 1hz
HEART-• The ground station or companion computer requests the data it wants (andthe rate) by sending messages of the following types
REQUEST-DATA-STREAM supports setting the rate of groups of sages
mes-COMMAND-LONG containing a SET-MESSAGE-INTERVAL commandprovides precise control of which messages are sent (and their rate) but isonly supported on ArduPilot 4.0 and higher
• Ground station or companion computer send commands to the vehicle
Heart Beat
The heartbeat protocol is used to advertise the existence of a system on the
Trang 384.2 Component
• Discover systems that are connected to the network and infer when they havedisconnected A component is considered to be connected to the network ifits HEARTBEAT message is regularly received, and disconnected if a number
of expected messages are not received
• Handle other messages from the component appropriately, based on nent type and other properties (e.g layout a GCS interface based on vehicletype)
compo-• Route messages to systems on different interfaces
Send Data
The USV now is sending general information about the status if the system, thesensor available in the system and their status
25
Trang 394.2 Component
Send Command (COMMAND-LONG)
The MAVLink command protocol allows guaranteed delivery of MAVLinkcommands
Trang 404.2 Component
Commands are values of MAV-CMD that define the values of up to 7parameters These parameters and the command id are encoded in COMMAND-INT or COMMAND-LONG for sending
he protocol provides reliable delivery by expecting a matching ment (COMMAND-ACK) from commands to indicate command arrival, and result
acknowledge-If no acknowledgement is received the command must be automatically re-sent
Long running operations may be cancelled by sending the COMMAND-CANCELmessage The drone should cancel the operation and complete the sequence
by sending COMMAND-ACK with CANCELLED
COMMAND-ACK.result=MAV-RESULT-• If cancellation is not supported the drone can just continue to send progressupdates until completion
27