Degree Thesis Mechatronic Engineer, 180 Credits
Total Page:16
File Type:pdf, Size:1020Kb
Degree Thesis Mechatronic Engineer, 180 credits Control and Autonomy of a Water Quality Measuring Unmanned Surface Vehicle (USV) Catfish project - Control and Autonomy Mechatronics, 15 credits Halmstad 2021-06-20 Vidar Hårding HALMSTAD UNIVERSITY ABSTRACT This report is about the implementation of autonomy and control on a water quality measuring unmanned surface vehicle. The project was termed Catfish and involved five teams focusing on different as- pects of the initial goal to create an autonomous three-part system; a surface drone, a submerged drone and flying drone. In this itera- tion of the Catfish project the focus laid on creating the surface drone and submerged drone as the Catfish project will improve over gener- ations of thesis projects. The author of the report was in the Control and Autonomy team and had been tasked with giving the surface drone the autonomy needed to make this project viable. Existing ad- vances made in autonomy was adopted and tested. With the help of estimation algorithms, and sensor fusion, a flight controller navigates the surface drone between a set of GPS waypoints. It is also able to counteract the external forces wind, waves and stream to keep its po- sition. To reach this autonomy four test phases were conducted on a pre-prototype with progressively increased difficult autonomy start- ing with manual control and ending in advanced autonomy. When the advanced missions were executed the speed and accuracy of two different thruster configurations were examined and the best perform- ing out of the two was implemented on the final prototype the other teams had designed. The project ended with a fully autonomous sys- tem that was able to execute all the navigational maneuvers required to operate autonomous water quality measuring missions. ii SAMMANFATTNING Den här rapporten handlar om implementationen av autonomi och kontroll på en vattenkvalitetsmätande vattenburen drönare. Projek- tet fick namnet Catfish och blev indelat i fem teams som fokuserade på olika aspekter av ett 3-delsystem; en vattenburen, en undervat- tens och en flygande drönare. I denna iteration av Catfish projek- tet fokuserade medlemmarna på att utveckla den vattenburna och undervattens drönaren då projektet kommer fortsätta utvecklas un- der kommande generationer av Catfish projektrapporter. Författaren av den här rapporten ingick i ett team som hette "Control and Au- tonomy" och hade i uppgift att installera en autonom intelligens till den vattenburna drönaren för att göra Catfish prototypen använd- bar. Befintliga framsteg inom forskningsområdet blev granskade och testade. Genom att använda uppskattningsalgoritmer och "sensor fu- sion" lyckades en "flight controller" navigera drönaren mellan GPS- waypoints och även behålla sin position genom att motverka krafterna från vind, vågor och strömmar. För att uppnå denna nivå av au- tonomi utför en förprototyp fyra testfaser av ökad autonomisk svårhets- grad. Under uppdraget blev hastigheten och precisionen av två olika motoruppsättningar undersöka och den som presterade bäst blev im- plementerad på den slutgiltig designen som de andra teamen hade utvecklat. Projektet avslutades med att ett fullt autonomt system blev utvecklat som var kapabel till att utföra alla navigationsmanövrar nödvändiga för att genomföra autonoma vattenkvalitetsmätningsup- pdrag. iii ACKNOWLEDGEMENTS Many thanks go to my teammates and friends in the Catfish team Micheal Forschlé, Evelin Bergvall, Pontus Palmqvist, Ellen Nihl, Eek de Bruijckere, Sebin Sunny, Meenu Joy Chirappanath, Jasmin Borgert, Aldonna Jasa Prima Purba, Katarzyna Nowak, Alireza Esmaeilzadeh and Harey Blanco that pioneered this project along side me. I would also like to thanks Eren Erdal Aksoy for supervising me and Inno- vation Lab for creating such an interesting project and investing the resources needed to finance it. iv CONTENTS List of Figures vi List of Figures vii Acronyms viii 1 introduction2 1.1 Purpose 2 1.1.1 Overarching Mission 3 1.2 Problem formulation 3 1.2.1 Hardware Requirements 4 1.2.2 Software Requirements 4 1.2.3 Tests 5 1.2.4 Limitations 5 2 background6 2.1 Autonomous surface vehicle 6 2.1.1 USV modeling 7 2.1.2 Thruster configurations 8 2.2 Lithium Battery 9 2.3 Extended Kalman Filter 9 2.4 GNSS 11 2.5 Course Control 11 2.6 Flight controllers 12 2.7 Software 12 3 method 14 3.1 T200 thrusters 14 3.2 Power Management System 15 3.3 Pre-prototype design 16 3.4 System Communication 17 3.5 Navigation System 17 3.6 PID Tuning 18 3.7 Loiter mode 18 3.8 Tests 19 4 results and discussion 22 4.1 GPS Accuracy 22 4.2 Test Results 24 4.2.1 First Test Phase 24 4.2.2 Second Test Phase 24 4.2.3 Third Test Phase 26 4.2.4 Fourth Test Phase 30 4.3 Examination of tests 31 4.4 Project Evaluation 33 4.5 Lessons learnt 33 5 conclusion 34 v contents vi bibliography 36 Bibliography 36 i appendix 40 a appendix 41 a.1 Final installation of electronics in Catfish Prototype 41 a.2 Final Catfish Prototype 41 a.3 Python code on Raspberry Pi 42 LISTOFFIGURES Figure 1 Mission Layout. 3 Figure 2 Two different thruster configurations 8 Figure 3 Kalman process 9 Figure 4 Mission Planner 13 Figure 5 QGroundcontrol 13 Figure 6 T200 Drawing 15 Figure 7 Power Circuit 15 Figure 8 Pre-Prototype V1 16 Figure 9 Pixhawk communication 17 Figure 10 Acro mode PID regulation 18 Figure 11 Advanced autonomy test 20 Figure 12 Number of satellites during mission 22 Figure 13 GPS accuracy 23 Figure 14 Pre-prototype V2 25 Figure 15 Trajectory correction 26 Figure 16 Differential Thrust Advanced Mission 27 Figure 17 Distance from current travel segment 27 Figure 18 Speed and Control 28 Figure 19 OmniPlus Advanced Mission 29 Figure 20 OmniPlus - XTrack 29 Figure 21 Speed and Control 30 Figure 22 OmniPlus - Loiter Distance from Waypoint 31 Figure 23 ESC control by the Pixhawk 32 vii ACRONYMS DOF Degree Of Freedom EKF Extended Kalman Filter ESC Electronic Speed Controller GPS Global Positioning System GNSS Global Navigation Satellite System PID Proportional Integral Derivative PWM Pulse Width Modulation ROV Remotely Operated underwater Vehicle RC Remote Controller SMHI Sveriges Meteorologiska och Hydrologiska Institut UAV Unmanned Aerial Vehicle USV Unmanned Surface Vehicle viii INTRODUCTION 1 This project was inspired by the research project "Saving Norra Dragsviken" which investigates the environmental pollution of Norra Dragsviken’s water bodies, a shallow sea region in the Baltic sea [1]. In this coastal environment the surrounding societies have caused eutrophication and leakage of environmental pollutants. To deter- mine the pollution of water samples the scientists measure temper- ature, particulate matter (turbidity), conductivity and acidity (pH). Currently the majority of the water samples are taken manually. This results in a limited precision of the measurements as there occurs a delay from when the sample is taken to when it is analysed in a lab. This process is time consuming and cumbersome and limits the ac- cess to crucial data about our surrounding water bodies. This project aims to facilitate access to data on water quality to promote informed decisions on treatments, or evaluate the current state of the environ- ment for research facilities, municipalities, and private landowners alike. A continuous stream of data on the water quality has potential to map completely new correlations between levels of water pollu- tion and activities of our societies (such as waste water treatment and farmland management). 1.1 purpose To solve this problem “Innovation Lab” that is an organ of the technol- ogy lab “Fab lab” at Högskolan i Halmstad has gathered a team of 11 students consisting of bachelor and master level students to create an intelligent drone system. This drone system shall with autonomous steering navigate to pre-set coordinates controlled by a computer or a cellphone. The data on concentrations of given pollutants shall be streamed back in real-time, or stored and possible to download af- ter completed mission [2]. The project was termed Catfish and is divided into 5 different parts, Environmental Analysis, Control and Autonomy, Data and Sensors, Product Development, and UX Design. This thesis will cover the authors contributions to the Control and Au- tonomy team where he was responsible for implementing the central intelligence, i.e. the communication between software and hardware and optimize the control of the motors for the surface drone. The the- sis focuses on which motor configuration that is best for navigation of the surface drone. The long-term goal, pre-requisites and limita- tions for the project were defined in close collaboration between the Catfish team and the Innovation Lab stakeholders. 2 1.2 problem formulation 3 1.1.1 Overarching Mission As an end result, combining efforts from all Catfish sub-teams, we will construct a surface drone that can navigate in all directions and maintain its position in running water. Figure 1 shows the course in the Nissan river the final Catfish prototype is planned to complete. These waypoints will be pre-programmed and at each waypoint the Catfish shall keep its positions. Figure 1: Mission Layout for a test sampling of the Nissan river. H is the starting point and coordinates 1-4 are the waypoints. 1.2 problem formulation The current study’s objectives were; developing the software, con- structing a pre-prototype, testing and analysing the thruster configu- rations. In the current study an implementation of the autonomously controllable system on a pre-prototype was installed which later could be transferred to the final prototype that the Product Development team [3] created. 1.2 problem formulation 4 1.2.1 Hardware Requirements Hardware requirement of particular relevance to the current sub-project are: Power system: All components of the drone system must be pow- ered by rechargeable batteries.