Master's Thesis
Total Page:16
File Type:pdf, Size:1020Kb
MASTER'S THESIS Autonomous Takeoff and Landing for Quadcopters Robert Lindberg 2015 Master of Science in Engineering Technology Space Engineering Luleå University of Technology Department of Computer Science, Electrical and Space Engineering Abstract In this project an automated takeoff and landing system for quadcopters was devised. This will make unmanned aerial vehicles (UAVs) less dependent of human supervision which could improve for example swarms of quadcopters where humans cannot control all in detail. Quadcopters are used due to their mobility and ability to hover over a specific location, useful for surveillance and search missions. The system is self-contained and real time processing is done on board. To make the project possible, software for an onboard computer had to be developed and put on the quadcopter. The onboard computer is controlled from a ground station which can give high level commands such as takeoff, land and change altitude. Experiments were conducted in a laboratory environment to measure the effectiveness of the takeoff, hovering, and landing commands. The parameter used to control the sensor fusion, the time constant in z direction, was found to have an optimal value of 3.0 s. When tracking the desired altitude the root mean square error is in the order of a few centimetres. ii Acknowledgements I would like to thank my supervisor Dr. Jan Carlo Barca at Swarm Robotics Laboratory and Monash University for giving me the opportunity to doing an interesting research project while also experiencing a new country. Dr. Hoam Chung for the expertise and help you have given me throughout the project. Senthooran Ilankaikone for the all the time you spent helping me when I needed an extra hand and for all the ideas to make this project possible, even though we did not get a dancing pole in the lab. I would also like to thank Stiftelsen Bj¨ornWahlstr¨omsfond and Angpan-˚ nef¨oreningensForskningsstiftelse for the financial support in forms of schol- arships during my time in Australia. Also to my parents who have supported me during my studies as well as and helping to move and carry my stuff around. Everything from clearing out my apartment in Kiruna at -40 ◦C to carrying sofas in Melbourne at +30 ◦C. Finally to my friends, both new and old, that made the trip to Australia a memory for life. iii Contents Abstract ii Acknowledgements iii 1 Introduction 1 1.1 Background . 1 1.2 Research Questions . 1 1.3 Thesis Structure . 2 2 Methodology 3 2.1 Construct a Conceptual Framework . 3 2.2 Develop a System Architecture . 3 2.3 Analyze and Design the System . 4 2.4 Build the (Prototype) System . 5 2.5 Experiment, observe, and evaluate the system . 5 3 Literature Review 6 4 Initial System Overview 8 4.1 Connections . 8 4.2 Mission Planner . 10 4.3 MAVLink . 10 4.4 PuTTY . 10 5 Design and Development 11 5.1 Overview and Connections . 11 5.2 Sonar . 13 5.2.1 Mounting . 13 5.2.2 Calibration . 13 5.3 ArduPilot Mega . 14 5.3.1 Setup . 16 5.3.2 APM Software . 17 5.3.2.1 Sonar . 17 5.3.2.2 Sensor fusion . 18 5.3.2.3 Custom mode . 19 5.4 BeagleBone Black . 21 5.4.1 Mounting . 21 5.4.2 Setup . 21 5.4.3 BBB Software . 22 iv 6 Experiment Design and Results 27 6.1 Optimal Time Constant for Frame Setup . 28 6.2 Optimal Time Constant for Free Flying . 34 6.3 Target Altitude for Free Flying . 38 7 Conclusions 42 8 Future Research 43 Appendix 48 v List of Figures 1 The Xaricraft x650v8 quadcopter. 8 2 The initial system as it was before any modifications. 9 3 Overview of the software and protocols. 9 4 Overview of the autonomous system. 12 5 Mounting of the sonar on the back of the quadcopter. 13 6 Plotted calibration results for sonar. 14 7 Custom mode flow chart. 20 8 Mounting of the BBB on top of the quadcopter. 22 9 pc flow chart. 24 10 apm flow chart. 24 11 input flow chart. 25 12 cmd flow chart. 26 13 The frame used for the experiments. 29 14 RMS distance average between sonar altitude and target al- titude according to which the optimal value for TC Z should be about 3 s. 32 15 RMS distance average between filtered altitude and target al- titude according to which the optimal value should be some- where between 3 s and 7 s. 32 16 Average number of oscillations per minute. Higher value of TC Z results in less oscillations. 33 17 Quadcopter average takeoff time for each experiment. The takeoff time does not seem to be noticeably affected by TC Z. 34 18 Quadcopter average landing time for each experiment. The landing time does not seem to be noticeably affected by TC Z. 35 19 The setup for the free fly experiments. 36 20 RMS distance average between sonar altitude and target al- titude for different target altitudes. Higher target altitude increases the average distance between the quadcopter and target altitude during the flight. 39 21 Average takeoff time for different target altitudes. Increased target altitude results in decreased takeoff time. 40 22 Average landing time for different target altitudes. Increased target altitude results in increased landing time. 41 23 Average number of oscillations per minute for different target altitudes. 41 vi List of Tables 1 Calibration results for sonar. Bold values are above the mini- mum distance and are the ones used for the calibration. 15 2 Results from sonar measurements. Bold values are the lowest value for each column. 31 3 Results from filter measurements. Bold values are the lowest value for each column. 31 4 Results from sonar measurements for different TC Z values. Bold values are the lowest value for each column. 37 5 Results from filter measurements for different TC Z values. Bold values are the lowest value for each column. 37 6 Results from sonar measurements for different target altitudes. Bold values are the lowest value for each column. 38 7 Results from filter measurements for different target altitudes. Bold values are the lowest value for each column. 39 vii List of Equations 1 Sonar distance-voltage dependency . 14 2 Complementary filter . 18 3 Position error . 19 viii List of Acronyms AN Analogue APM Ardupilot Mega 2.5 BBB BeagleBone Black ESC Electronic Speed Control GND Ground IR Infrared IMU Inertial Measurement Unit MP Mission Planner MAVLink Micro Air Vehicle Communication Protocol RMS Root Mean Square SLAM Simultaneous Localization And Mapping ix 1 Introduction This research is about devising an autonomous takeoff and landing system for quadcopters. An autonomous system would reduce the need of human supervision and would therefore increase the possible fields of use. This is a first step to develop a fully autonomous system that could be used for e.g. surveillance or search and rescue missions. No human supervision means the system can be active on a constant basis and also reducing the risk of human mistakes. This is also essential for swarm robotics where it is not possible to control every unit in detail. The system is required to work in an indoor environment and therefore no GPS or barometer can be used. The reason a barometer cannot be used is because it measures air pressure and the turbulence from the quadcopter may give unreliable results. The system is also a first step to implement a custom mode that can be modified further in the future to implement more functions. The final goal for the quadcopters are to be able to land and takeoff to a specific height in unknown terrain, so no help such as markers or maps have been used. 1.1 Background For the firmware used on the autopilot there are already autonomous takeoff and landing functions available when using waypoint navigation. The prob- lem with this is that it requires an active GPS connection to work and since that is not an option for this project new functions had to be devised. 1.2 Research Questions Three research questions were devised to guide the course of the project. • How to set and reach a target altitude with the quadcopter? • How to make the quadcopter hold the altitude until further notice? • How to make the quadcopter perform a safe landing? 1 1.3 Thesis Structure Chapter 1 is this short introduction to the problem and which research ques- tions that is expected to be answered during the course of the research. Chapter 2 is about the research methodology used to make sure the research results are valid. Chapter 3 offers a literature review where previous work are presented. Also why this research is important and what problems there are. Chapter 4 provides a short explanation of the functions of the system be- fore the modifications. It also explains the software used to help in this project. Chapter 5 describes the design process and final design of all the modified parts of the system. This also includes both the development and how ev- erything was calibrated and set up to work properly. Chapter 6 presents the experiments made to verify the research questions. 2 2 Methodology A research methodology was adapted to increase the chance of success by following a guideline on how to proceed with the research. A System De- velopment Research Methodology [1] was selected as it has been proven to work in earlier research made by people in the Swarm Robotics Laboratory which therefore also have experience working with it. It provides five steps to follow during the research.