[PDF] On an Android-based Arduino governed unmanned Quadcopter





Previous PDF Next PDF



ARDUINO MEGA2560 ADK (for Android)

22 ?.?. 2558 PK0(ADC8/PCINT16). 89. PK1(ADC9/PCINT17). 88. PK2(ADC10/PCINT18). 87. PK3(ADC11/PCINT19). 86. PK4(ADC12/PCINT20). 85. PK5(ADC13/PCINT21).



?? ???????? ?????? ????????????????? ?? ? ET-MEGA2560-ADK

ET-MEGA2560-ADK. ????????? Arduino ????? ????????????????? MCU ??? AVR ??? Open Source ?? ??????. ???????????? ??????? ??????? 



????? ???????????? ? USB Host ??? Android ETT CO.LTD

???????????? ?????????????? ????? ??????????? ? ET-MEGA2560-ADK ??????? ???? Android ?????? ? USB Host ????? ????????????????? ADB (Android Debug ...



Arduino Mega ADK ???????????????????????????? Mega 2560 R3 ????

Arduino Mega ADK ???????????????????????????? Mega 2560 R3 ?????????????????????? Android. Device?????????USB Host ???????????.



????????1 ??????????????????????????????????????????

??????? Arduino Uno R3. 12. Arduino Mega ADK ???????????????????????????? Mega 2560 R3 ???????????????. ???????Android Device ????????? USB Host ???????????.



Arduino

??????????? AVR ??????????????????????? C++ ??? Arduino ?????? ?????? ???? ?????????????????? ADK (Android Open Accessories Development Kit) ???????????.



Arduino and Android Powered Object Tracking Robot

The Android device is used to control the robot through the Arduino We chose to go with the Arduino Mega 2560 ADK board [A3].



On an Android-based Arduino governed unmanned Quadcopter

6 ?.?. 2557 Don't forget to set your type of Arduino board (Tools > Board > Arduino Mega 2560 or Mega. ADK). 3.2.1.3.1: Required libraries. These are the ...



?????????????????????????????????????????? D

???????????? USB Device ??????????? Android ADK ????????????????????????? ADK ?????????????????Arduino ???? ET-MEGA2560 – ADK.



Android Accessory Protocol - FTF2014

Android Open Accessory 1.0 is a protocol that allows an. Android device to interact with an Android Hardware for ADK 2011 is based on a Arduino Mega2560.

On an Android-based Arduino-governed

unmanned Quadcopter platform:

The CDIO Academy case

Thesis by: Carles Carruesco Picas

Advisors: Eduard Alarcón Cot

Elisenda Bou Balust

Barcelona

October 2014

On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 1

Abstract

This thesis covers the design, implementation and application of a capstone project surrounding Air-Sensing Engines in Smart Cities. The task is to achieve autonomous control of an Unmanned Air Vehicle (a quadcopter; small four rotor helicopter) using an onboard smartphone and an Arduino board with air quality sensors.

It is divided in three main sections: design process, project platform and application.

Design process follows all the process from initial idea to final working prototype; choosing an aircraft and how to control it, how the software is designed to allow easy tinkering and adaptation and all the tests performed to ensure the proper functioning.

Project platform is a reference book for developers and anyone who wants to use this platform. It contains in depth descriptions of how each part works.

Application shows how this capstone project was successfully used in the CDIO Academy 2014 as a multidisciplinary challenge.

On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 2

Acknowledgments

I want to first thank my colleague Gonzalo Martínez for all his work and dedication on the hardware side: choosing and calibrating sensors, prototyping with different configurations and building all the final units. This project would not have succeeded without him.

Also thank my thesis directors Eduard Alarcón and Elisenda Bou for their continued support and assistance throughout the project; especially Elisenda, who also developed and maintained the web server for the GroundStation and its web interface.

Finally, thank Carles Araguz and David Rodríguez for all their help organizing and running the CDIO

Academy event.

On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 3

Table of contents

Abstract ......................................................................................................................................... 1

Acknowledgments ......................................................................................................................... 2

Table of contents ........................................................................................................................... 3

List of figures ................................................................................................................................. 5

1: Introduction ........................................................................................................................... 6

1.1: Rationale ........................................................................................................................ 6

1.2: Objectives ...................................................................................................................... 6

2: Design process ....................................................................................................................... 7

2.1: The goal ......................................................................................................................... 7

2.2: How to control a quadcopter ........................................................................................ 8

2.3: Choosing the unit. Commercial versus DIY .................................................................... 8

2.3.1: Requirements ........................................................................................................ 8

2.3.2: 3DR Iris ................................................................................................................... 9

2.4: Arduino RC emulation .................................................................................................... 9

2.4.1: Manual override .................................................................................................. 10

2.5: Communicating with the Arduino board ..................................................................... 11

2.6: First tests ..................................................................................................................... 12

2.7: Sensors ........................................................................................................................ 16

2.8: Android software. QuadADK ........................................................................................ 17

2.8.1: Flight mission ....................................................................................................... 17

2.9: System integration ....................................................................................................... 19

2.10: Final tests and validation ......................................................................................... 21

3: Project platform................................................................................................................... 22

3.1: Hardware ..................................................................................................................... 22

3.1.1: Quadcopter .......................................................................................................... 22

3.1.2: Added components ............................................................................................. 22

3.1.2.1: Android smartphone .................................................................................... 22

3.1.2.2: Arduino MEGA ADK ..................................................................................... 23

3.1.2.2.1: Body modifications ................................................................................... 24

3.1.2.3: Sensors ........................................................................................................ 25

3.1.3: Calibrations .......................................................................................................... 25

3.1.3.1: Quadcopter .................................................................................................. 25

3.1.3.2: Others .......................................................................................................... 27

3.2: Software ...................................................................................................................... 28

On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 4

3.2.1: Environment setup .............................................................................................. 28

3.2.1.1: Source code ................................................................................................. 28

3.2.1.2: Android SDK ................................................................................................. 28

3.2.1.2.1: Google APIs ............................................................................................... 28

3.2.1.2.2: Required libraries ..................................................................................... 29

3.2.1.3: Arduino IDE .................................................................................................. 30

3.2.1.3.1: Required libraries ..................................................................................... 30

3.2.2: Software walkthrough ......................................................................................... 31

3.2.2.1: ArduinoADK .................................................................................................. 31

3.2.2.1.1: RC emulation ............................................................................................ 32

3.2.2.1.2: Sensors ..................................................................................................... 33

3.2.2.2: QuadADK ..................................................................................................... 33

3.2.3: Modules ............................................................................................................... 34

3.2.3.1: Communications .......................................................................................... 34

3.2.3.1.1: Arduino ̽ Android .................................................................................... 34

3.2.3.1.2: Android ̽ GroundStation .......................................................................... 35

3.2.3.2: Sensors ........................................................................................................ 35

3.2.3.2.1: Camera ..................................................................................................... 35

3.2.3.2.2: GPS ........................................................................................................... 35

3.2.3.3: Mission ........................................................................................................ 36

3.2.4: Further development ........................................................................................... 38

4: Application ........................................................................................................................... 39

4.1: CDIO ............................................................................................................................. 39

4.2: CDIO Academy ............................................................................................................. 39

4.3: Challenge description .................................................................................................. 40

4.4: Comments and results ................................................................................................. 41

5: Conclusions .......................................................................................................................... 44

6: Appendices .......................................................................................................................... 45

6.1: Pulse Position Modulation ........................................................................................... 45

6.2: Arduino ̽ Android communication protocol ............................................................... 46

6.3: GPS height precision .................................................................................................... 47

References ................................................................................................................................... 48

Glossary ....................................................................................................................................... 50

On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 5

List of figures

Figure 1: Overview of the goal ....................................................................................................... 7 Figure 2: The 3DR Iris ..................................................................................................................... 9 Figure 3: RC Emulation scheme ................................................................................................... 10 Figure 4: Manual override switch ................................................................................................ 10 Figure 5: Arduino MEGA ADK board ............................................................................................ 11 Figure 6: Broken support panel ................................................................................................... 12 Figure 7: The new support panels ............................................................................................... 13 Figure 8: Latitude and longitude coordinates .............................................................................. 13 Figure 9: Early prototype with GPS module under the support panel ......................................... 14 Figure 10: Final model with GPS module elevated ...................................................................... 14 Figure 11: Very early prototype of smartphone support ............................................................. 15 Figure 12: Wobbly effect with the old support ............................................................................ 15 Figure 13: Wobbly effect with the new support .......................................................................... 15 Figure 14: The Egg Shield board .................................................................................................. 16 Figure 15: The MPL3115A2 sensor in a breakout board .............................................................. 17 Figure 16: The NavigationTest program ...................................................................................... 18 Figure 17: System overview ......................................................................................................... 19 Figure 18: The GroundStation web interface .............................................................................. 20 Figure 19: Finished unit ............................................................................................................... 21 Figure 20: RC controls .................................................................................................................. 22 Figure 21: Extended legs .............................................................................................................. 23 Figure 22: Components and their location .................................................................................. 24 Figure 23: Accelerometer calibration wizard ............................................................................... 25 Figure 24: Compass calibration wizard ........................................................................................ 26 Figure 25: RC calibration wizard .................................................................................................. 27 Figure 26: Android SDK Manager ................................................................................................. 28 Figure 27: Project properties, build target .................................................................................. 29 Figure 28: Arduino IDE ................................................................................................................. 30 Figure 29: RC emulation in the source code ................................................................................ 32 Figure 30: QuadADK interface ..................................................................................................... 33 Figure 31: Sample mission flow diagram ..................................................................................... 38 Figure 32: CDIO logo .................................................................................................................... 39 Figure 33: Challenge diagram ...................................................................................................... 40 Figure 34: Participants working (1) .............................................................................................. 42 Figure 35: Participants working (2) .............................................................................................. 42 Figure 36: Participants working (3) .............................................................................................. 43 Figure 37: One of the quadcopters used for the challenge ......................................................... 43 Figure 38: Example of a PPM stream ........................................................................................... 45 Figure 39: Arduino - Android message blueprint ......................................................................... 46 Figure 40: Arduino - Android command IDs ................................................................................ 46 Figure 41: Smartphone GPS log ................................................................................................... 47

On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 6

1: Introduction

1.1: Rationale

Unmanned Aerial Vehicles are a hot topic these days; companies like Amazon and Google are preparing to offer delivery services (Amazon Prime Air [1] and Google's Project Wing [2]), film producers are starting to use multirotor helicopters to capture aerial images [3] and, once regulations are finished, many more commercial applications will arise [4]. Since it is a relatively new field, there are many research possibilities. Also, although UAVs are

often related to military uses, there are a lot of possibilities and civil applications waiting to be

developed. For this reason, it is a very interesting topic to work on. Another key aspect is the multidisciplinary nature of this topic. Designing multirotor helicopters requires mechanical engineers and aerodynamic engineers to properly stabilize it, this stabilization has then to be translated into software by computer science engineers. All this just for flying, then comes application development which will need expertise in its field to properly incorporate it in a UAV. The possibilities for applications are truly endless: consumer oriented like fast package delivery, remote sensing with any sensor you can fit in the unit

(irrigation control of large plantations, environmental studies, traffic monitoring, etc.) and

emergency and disaster response like scouting for survivors, building temporary communication networks and navigating through hard terrain like mountains or debris. This capstone project illustrates the design process and system integration with an air sensing application: designing the unit and its control systems as well as working with two important aspects of UAVs: autonomous navigation and working with sensors. With this sample application, this capstone project portrays the possibilities of UAVs and provides an entry point to work and research within this topic.

1.2: Objectives

The aim is to create a generic UAV platform and use it in an air sensing application that navigates through a city and gets air quality and pollution readings. This platform will have to be easily reproduced and thus, all the documentation will be public and freely available; the source code being already available in a public GitHub repository [5]. It is also important that in can be used for a different application so both hardware and software will have to be easily modifiable. Finally, this project will also be used as a challenge in the CDIO Academy 2014, where teams of interdisciplinary students from around the world will compete to build the best implementation. The platform will have to be adapted to open some degrees of freedom and design choices for the challenge. On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 7

2: Design process

2.1: The goal

The goal of this capstone project is to have an autonomous quadcopter that follows a predefined set of waypoints, makes measurements of air quality, takes photos and uploads all the data to a public server. There are many ways to achieve this goal. Our solution consist of an Android smartphone and an Arduino board; the smartphone handles navigation and makes decisions while the Arduino board houses all the required sensors and controls the quadcopter (according to the orders of the smartphone).

Figure 1: Overview of the goal

What follows is the design process and all the choices we have made to get to this solution. On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 8

2.2: How to control a quadcopter

First and most important step is how to communicate with the quadcopter. All of them, even DIY

solutions (more on that later), have a flight control unit that takes care of stabilization; some also

include assisted flight modes like locked altitude (usually called altitude hold). Interacting with these flight control units requires firmware modifications and, while some of them are open source and thus it's possible to make said modifications, it would require a long time; time we didn't haǀe. Instead, we went for a simpler approach; the smartphone would emulate a person controlling the quadcopter, in other words, it would emulate an RC. With this solution the firmware requires no modifications as it just sees a regular RC. The Arduino board that hosts all the required sensors would also take care of RC emulation; more on this later.

2.3: Choosing the unit. Commercial versus DIY

The quadcopter can either be a commercial product or a DIY unit for the participants to build. This choice has a major impact on both time and skills required, as building it is no easy task. Given the time constraints of the challenge, using a DIY solution was not an option. That said, a

DIY solution can still be used for this capstone, if the application allows it, because its flight control

unit is very similar, if not identical, to most commercial units.

2.3.1: Requirements

The unit, either commercial or DIY, will have to include a flight control unit with these capabilities:

Automatic takeoff and landing

Stabilized flight mode that allows easy horizontal and vertical movement Enough lift power to carry the payload (Arduino board, sensors and smartphone) (Not strictly required but strongly recommended) Safety features such as automatic landing when battery is low and ability to set a flight zone the unit can't leaǀe. On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 9

2.3.2: 3DR Iris

The unit chosen for this project is the Iris from 3D Robotics [6]1, a Ready-To-Fly commercial solution.

Figure 2: The 3DR Iris

Specifications:

ƒ Motor to motor dimension: 550 mm

ƒ Height: 100 mm

ƒ Weight (with battery): 1282 g

ƒ Average flight time: 9 - 14 minutes

ƒ 400 g payload capacity

ƒ Battery: 3-cell 11.1 V 3.5 Ah lithium polymer with XT-60 type connector. Weight: 262 g ƒ Propellers: (2) 10 x 4.7 normal-rotation, (2) 10 x 4.7 reverse-rotation

ƒ Motors: AC 2830, 850 kV

ƒ Telemetry/Control radios available in 915 MHz or 433 MHz ƒ 32-bit Pixhawk autopilot system with Cortex M4 processor (flight control unit)

ƒ GPS receiver with integrated magnetometer

It fulfills all the requirements and includes the useful loiter flight mode that locks the unit in space.

The 400 g payload capacity is enough for this project and the battery lasts for two missions.

2.4: Arduino RC emulation

RC receivers usually have PWM or PPM outputs; the main difference being PWM uses one output per channel whereas PPM multiplexes all the channels into a single output. The unit used for this project uses a PPM receiver. For more information on PPM see appendix 1: Pulse Position

Modulation.

The program developed for the Arduino board generates the PPM stream of the emulated RC and sends it to the Flight Control Unit as if it was a regular receiver. This, however, leaves all control to the smartphone and its autonomous flight program, which could be a huge problem if said program misbehaves. To solve this issue we have to be able to get manual control over the aircraft at any time.

1 The Iris is no longer available; instead, 3DR offers the Iris+, an improved model.

On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 10

2.4.1: Manual override

The manual override, or manual switch, is the security feature which guarantees that, no matter what the autonomous program is doing, we can always get manual control. We connected the original RC receiver to one of the Arduino inputs and used a two position switch, in a non-used channel, to switch between manual and automatic, autonomous, mode.

Figure 3: RC Emulation scheme

The Arduino is constantly reading form the real RC and generates an output stream accordingly. See 3.2.2.1.1: RC emulation for more information on how this is accomplished.

Figure 4: Manual override switch

On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 11

2.5: Communicating with the Arduino board

The smartphone communicates with the Arduino board to ͞moǀe" the ǀirtual RC and perform measurements with the sensors. This communication narrows the smartphone platform choice down to Android; here is how: the other major mobile OSs, Apple's iOS and Microsoft's Windows Phone, can only talk with Arduino through a wireless link, usually Bluetooth or Bluetooth Low Energy, while Android also has the possibility to connect via USB; Arduino acting as a USB host. Using a wired link offers two important advantages: ƒ More reliable than a wireless link in terms of error rate. and also powers the smartphone through USB (because it is the host). Google released its Accessory Development Kit (ADK) back at Google IO 2011 [7]; it was a modified Arduino board with sample source code to communicate with it. This is the framework we used to implement the communication link. For more information on Android's ADK, see its developer guide [8] or consult Beginning Android ADK with Arduino [9], a much recommended book. Note that the Arduino board must have a USB Host interface; you can use a regular Arduino with a USB Host shield or the Arduino MEGA ADK, based on the MEGA variant of Arduino with the USB Host interface built in. We used the latter for simplicity.

Figure 5: Arduino MEGA ADK board

It is also important to take into consideration the limited processing power of Arduino. To not waste resources, we designed a custom communication protocol focused on simplicity and short messages. See appendix 2: Arduino - Android communication protocol for more information. On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 12

2.6: First tests

At this point we had the first prototype built and a preliminary version of the software, time for some tests. With some simple flight mission we tested all the different systems: sensors, manual override, critical issues. First, the material used to add housing space for the added components, polymethyl methacrylate, was not strong enough.

Figure 6: Broken support panel

2 We use autonomous flight modes of the on board Flight Control Unit for automatic takeoff and landing;

much safer than trying to do it with the smartphone. On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 13 We needed a more resistant panel, either the same material but thicker or another material; because of supplier problems, we opted for a different material, wood-like.

Figure 7: The new support panels

The second most important issue, smartphone's compass was not accurate enough and thus, could not be used for navigation. We found a workaround by relaying on the assisted flight modes of the quadcopter, which has a much better compass; this modes lock orientation so the unit always points in the same direction. What we did was align the unit to North before every take off. This way latitude and longitude coordinates translate to forward/backward and left/right movements.

Figure 8: Latitude and longitude coordinates

Forward: Latitude ј Right: Longitude ј

Backward: Latitude љ Left: Longitude љ

On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 14 Another problem was the bad reception of the unit's GPS receiǀer, especially with the new panels. Without a proper GPS lock, the automatic modes did not work. To fix this issue we changed the GPS module position from under the panel to on top of it and elevated. See the following two images of before and after for comparison; the before image is an early prototype with the old panels (you can see how it was starting to break at the front), the after picture is from the final model. Figure 9: Early prototype with GPS module under the support panel

Figure 10: Final model with GPS module elevated

On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 15 Next, we also identified a critical issue with the manual override: given how the Arduino program worked, if it was overloaded or stuck because of bad code the manual override would not work. Unacceptable; the manual override must work at all times under any circumstances. We remade from scratch how it reads and generates RC signals so that it ran with interruptions, immune to overload. Another issue detected was a vibration of the smartphone that resulted in a wobbly effect in the photos. For these first tests we were using a rigid support to hold the smartphone in place. We fixed this problem by holding the smartphone with Velcro ties at the bottom of the unit; this change also allowed us to shorten the legs of the quadcopter, decreasing its center of mass and making it more stable, especially when landing. Figure 11: Very early prototype of smartphone support These two photos show the difference between the old support and the Velcro ties, the lines should all be straight. Figure 12: Wobbly effect with the old support Figure 13: Wobbly effect with the new support With the new support the effect is small enough to neglect it. On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 16 Another effect to take into account regarding the camera, if you take photos while moving the

result will be distorted since the unit is tilted. To take good pictures you have to give it some time

to stabilize. Finally, at this point we were using a custom Java server with a rudimentary connection; during the tests it was made clear that it had to be scrapped as the connection would constantly drop. It was substituted with a web server and standard HTTP; much more reliable.

2.7: Sensors

Regarding the sensors, we needed air quality readings and Arduino compatibility. Since the Arduino platform is widely used, there are plenty of extension boards (also known as shields) that add functionality; we used an extension board called Egg Shield [10], it has sensors for carbon monoxide (CO), nitrogen dioxide (NO2), temperature and humidity.

Figure 14: The Egg Shield board

It's also important to note that the carbon monodžide and nitrogen diodžide sensors haǀe a settling

time of about two minutes; measurements before they have settled are inaccurate. The Arduino board also has a standard I2C bus for compatible sensors. This bus can be used to add other sensors and add functionality to the system. Using this bus, we also added a barometric pressure sensor (MPL3115A2 [11]) to get altitude readings and allow vertical movement in the navigation algorithm. On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 17 Figure 15: The MPL3115A2 sensor in a breakout board Note that this sensor must be tightly covered with foam to offer proper readings; even then it may not be very precise. Our sensor had a small drift that resulted in a varying offset from the

real value. It was still usable with temporally close relative measurements; in other words, it could

still be used for things like increasing altitude by roughly 10 meters, not for keeping a record of flight altitude.

2.8: Android software. QuadADK

The Android program had to manage smartphone components (GPS and camera), handle the Arduino communication link and host the navigation algorithm. All these while being easy to modify, as the participants would have to develop their own navigation algorithms within the program. This is why we went for a modular approach; each function is encapsulated in a module and they can all intercommunicate. See 3.2.2.2: QuadADK and 3.2.3: Modules for more information. With this system, the navigation algorithm is encapsulated in the mission module and can be easily modified without knowledge of how the rest of the program works.

2.8.1: Flight mission

The flight mission is what the participants have to develop, it contains the navigation algorithm and instructions on how and when to make sensor measurements and photos. Developing this algorithm is not especially complicated; having to test it with flights however, is at least time consuming and potentially dangerous when the algorithm malfunctions; we still have the manual override to tackle this situations. To ease development, both for us and the participants, we developed another program that

works almost identically but is designed to be used walking instead of flying. It shows the

movement it wants to perform on the screen and the user walks in that direction. Using this program, testing and troubleshooting was easy and safe. On an Android-based Arduino-governed unmanned Quadcopter platform: The CDIO Academy case 18

Figure 16: The NavigationTest program

With the help of this tool, we tweaked the GPS error tolerances to increase location precision and navigation performance. Once the algorithm was good enough, we proceeded to play with the movement speed of the unit. Going faster means completing missions in less time (good) but going too fast will missquotesdbs_dbs23.pdfusesText_29
[PDF] Arduino - Premiers pas en informatique embarquee - Le blog d

[PDF] PDF Projets Arduino pour les Nuls ePub

[PDF] Télécharger Arduino Pour les Nuls, édition poche PDF

[PDF] PROGRAMMATION ARDUINO

[PDF] schematics in pdf - Arduino

[PDF] Package 'AUC ' - R

[PDF] Licencias de salud ocupacional - Ministerio de Salud y Protección

[PDF] Première connexion ? Base Elèves Premier Degré

[PDF] 1ere utilisation d une clé OTP - Lyon

[PDF] arena - palais des sports du pays d 'aix - SPLA PAYS D 'AIX

[PDF] aréna du pays d 'aix - Mairie d 'Aix-en-Provence

[PDF] https://extranetac-grenoblefr/arena

[PDF] plan d 'accès /access - Arena

[PDF] Mode opératoire - Académie de Toulouse

[PDF] Déclaration des services d enseignement - UFR ALLSH