St. George’s Robotics Team Autonomous Underwater Vehicle

Spencer Chan Calvin Cheng Cho Evan Johnson Spencer Louie Ezaan Mangalji Giulio Rossi Marcus Tan Kevin Tian Raymond Wang Carl Xi Leon Zhou

AUVSI Foundation and ONR’s 16th International RoboSub Competition SSC Pacific TRANSDEC, San Diego, CA July 22–28, 2013 Abstract

Following a successful showing at the 2009 AUVSI RoboSub Competition, the St. George’s Robotics Team has built a new autonomous underwater vehicle from scratch, which it is proud to enter into 2013 competition. The design of the robot is built around the general architecture of a dirigible airship; the main computer and batteries are located in a long cylindrical tube, with the “gondola” section of the robot housing the thrusters and propulsion system. The sensors attached to the system include an accelerometer, a gyroscope, a compass, a pressure (depth) sensor, and a Hall effect sensor, which will work in coordination with a Dreamplug computer to control the movement and direction of the AUV. Needless to say, the robot this year is merely a skeleton of what the team hopes to accom- plish in the upcoming years; the plan for competition this year will be more of a learning experience to see what can be improved upon in the future, in terms of both hardware and software. This is also the first time competing in the RoboSub competition for all of the team members; regardless, despite the lack of experience, the team hopes to remain competitive in the field with this autonomous underwater vehicle, which has taken the team three years to meticulously build and put together. 2013RoboSubCompetition JournalPaper

1 Introduction resulting in a much lengthier time required to construct this AUV. Build sessions have 1.1 Team Background typically occurred on Sunday afternoons, af- ter school on weekdays, and during holiday St. George’s School is a high school located breaks. in Vancouver, BC. Although the school is known for its myriad athletic, artistic, and The robotics team is divided roughly into academic pursuits, one area from which lit- three general groups. One part of the team tle is often heard is its robotics program. In focuses on the mechanical aspects of the 2009, the St. George’s Robotics team com- robot, using lathes, drill presses, and saws peted in the RoboSub Competition for the among other tools in order to craft the va- first time in school history, finishing 17th in riety of pieces required for this complex ma- the competition, and earning the “Best New chine. The second group, the programmers, Team” award. As the participants in compe- work intensely with the sensors and the com- tition are primarily prestigious universities, puter in order to create an interface that will this finish was quite an accomplishment for allow the robot to complete the course with the Saints team. the least margin of error possible. Robotics at St. George’s has always ex- Finally, a number of members work on isted an entirely extra-curricular endeavour; communicating information, not only be- the members of the robotics team do re- tween the former two groups, but to the search, plan collaboratively, and construct general public as to the progress of the the robot all outside of class time. The team robot. This group comprises the photog- that is participating in the competition this raphers, video producers, website designers, year is a completely new crew from the 2009 and report writers. Needless to say, cooper- team, as all of the members of the former ation between these groups was essential to team have graduated. The robot has also the success of the robot, so the team was very been built entirely from scratch: the philos- fortunate to comprise members who were so ophy of the team is that once all the members willing to work together to ensure that the who took part in the initial construction of AUV was built as efficiently and economi- the robot have departed, that robot must be cally as possible. retired. This current robot has taken three years to 1.2 Robot Design finally take shape. Unlike a number of other This AUV is based of the general structure teams in the competition, the St. George’s of a standard dirigible airship. Though the Robotics team runs on a very restricted bud- base elements were inspired by the robot get; the funding to the robotics program crafted by the team of 2009, a number of im- has been fairly limited over the past few provements have been added to address the years. As a result, the team has opted to shortcomings of the previous design. save money over time as much as possible, The main systems are housed inside a

St. George’s Robotics Team 1 2013RoboSubCompetition JournalPaper cylindrical acrylic tube, inside which the bat- knowledgeable about the design rationale be- tery compartments and main computer are hind most of the decisions made during the stored. At one end of the tube is the com- construction of this AUV, the team also pass, and at the other end, an aluminium hopes to gain points simply through their end cap to dissipate the heat generated by knowledge of the inner workings of the robot the computer within the module. during the static judging stage. Waterproof wires lead from the end cap into a thruster under an aluminium frame 2 Hardware suspended under the main tube. This thruster turns a brass rod, which is attached The hardware aspect of the AUV can be to a worm gear. As the worm gear con- roughly categorized into two main sections: nects to the thrusters on either side of the the mechanical portion, which includes all of robot, sending a signal to power the central the metals, plastics, and other materials used thruster (which results in the revolution of to construct the skeleton of the robot, and the worm gear) will cause the vertical an- the electrical portion, which comprises all gle of the forward thrusters on either side to of the onboard sensors, computers, and con- change. This is how the depth of the robot trollers used to navigate the AUV through- will be controlled; the powering of the two out the course. thrusters on either side when they are tilted upwards will cause the AUV to rise, and tilt- 2.1 Mechanical ing them downwards will cause the opposite The major mechanical parts of the AUVthe to occur. battery compartments and the computerare enclosed in the main housing. Below the 1.3 Mission Strategy main housing lie the parts needed for the op- The principal goal this year is fairly sim- eration of the three thrusters, which are used ple: to pass through the validation gate, fol- to control the propulsion and orientation of low the path, and finish up at the traffic the robot. light buoys. Based on the limited equip- ment/sensors available on board the AUV 2.1.1 Hull this year, this seems to be the most realis- The central components of the robot are tic estimate of the number of tasks that can housed inside an acrylic cylindrical tube, 3 be completed. feet in length with an 5.25-inch inner di- Although the number of tasks completed ameter and a 5.5-inch outer diameter. The seems to be small, the team also hopes to team opted for acrylic primarily because the gain a number of points via subjective mea- material is transparent, making more appar- sures, such as the quality of the team web- ent any leaks and any other issues issues in site, journal paper, and introductory video. the water. Acrylic is also quite durable, an Because every member of the team is quite important quality considering that the tube

St. George’s Robotics Team 2 2013RoboSubCompetition JournalPaper houses the most critical parts of the robot. batteries (1.2V each) in series was decided The end cap of the tube is crafted from upon, to ensure that sufficient power was aluminium, selected for its heat conductivity available to the robot. A lathe was used to and malleability. These properties reduced machine the half-inch sheet of acrylic into a the time required to machine the end cap circle, just enough for it to friction-fit into down to size and made it easier to fit the O- the cylindrical housing. Indents were drilled rings and waterproof wires into the end cap; at various points into the acrylic to fit brass furthermore, they allow for effective heat dis- rods—these rods would be used to connect sapation away from the computer mounted the two ends the battery holder, eventually to the end cap during the actual operation compressing the batteries within. of the robot. Arelativelylargeholewasalsodrilledinto Below the cylindrical tube is an aluminium the top of the material where no batteries frame which was used to hold the thrusters would be placed, for two reasons. The hole in place. Again, aluminium was chosen due lessens the weight of the robot, an impor- to its durability and relatively low cost. Be- tant consideration as the weight of the robot cause the frame will be immersed in water, is factored in during the competition. In ad- the frame was anodized to prevent corrosion dition, as the battery holder spans the entire and to increase surface hardness. In order to interior width of the central housing, space prevent the aluminium frame from scratch- was needed for the wires to pass through; the ing the acrylic tube, a foam cushion lies in hole accomplishes just that. between the frame and the tube. The foam was coated in fiberglass, to prevent the foam 2.1.3 Thrusters from chipping away in transport and to pre- The thrusters took perhaps serve its form when submerged. the longest time to ma- chine, as the budget did 2.1.2 Battery Compartments not allow for commercially- Within the acrylic tube lies the battery hold- made thrusters to be pur- ers. Much time was taken to ensure that the chased. Yet again, acrylic battery holders were built properly, as they was the material of choice would occupy the largest amount of space for the tube, as its transpar- within the tube. ent, lightweight, and cost- Acrylic was the ma- effective qualities was ideal. terial of choice, due The end caps were made of its strength and trans- acetal, due to its machin- parency. A total of 14.4 ability; as the team did not have access to volts were needed to large industrial power tools, ease of machin- power the entire robot, ing was a large factor in determining mate- so the usage of 12 D-size rials used.

St. George’s Robotics Team 3 2013RoboSubCompetition JournalPaper

2.2.1 Computer The computer on board the AUV is a DreamPlug system with a Marvell R ￿ SheevaTM Core embedded processor at 1.2 GHz, 4 GB of on-board flash memory, and 512 MB of 16-bit DDR2 SDRAM.

To further cut costs, the motors in all three thrusters were taken from old, unused hand drills and were machined to fit into the acrylic tubes. Each motor is connected to the end cap with a rod. However, as the thrusters will be placed in water and will thus encounter a significant amount of re- sistance, U-joints were placed on the rods to allow for vibration from outside without This computer was chosen over other vi- damaging the motors. able systems such as a due to Propellers were fitted onto the end of its lower cost and power consumption; even two of the thrusters; the final thruster was under maximum processing load, the system connected to a worm gear that would al- draws only 5 volts and 3 amps of power. low the other two thrusters to adjust their In addition, because the system has sev- vertical angle. On the other end of the eral ports and connections, including 2 USB three thrusters, the power supply was at- ports, 2 Gigabit Ethernet ports, an SD card tached; waterproof wire connections were slot, and WiFi connectivity, this computer crucial here, which will be described more in was quite effective at delivering all of the nec- depth in a later section. The wires brought essary input and output through the various power to the motor, which allowed the robot ports, despite the limited processing power. to run in the water. The small form factor of this computer also allowed for more space in the main housing, 2.2 Electrical as well as less weight. The electrical components of the AUV fol- Consideration was also given to the level lowed a similar thought process as that of of heat generated by the computer; in fact, the mechanical components—if a component one of the reasons this DreamPlug was cho- had to be purchased, the cheapest one that sen over more powerful computers is that provided the bare necessary utility was se- it would generate less heat. During the lected. team’s previous appearance at the competi- tion, overheating was a major problem; con-

St. George’s Robotics Team 4 2013RoboSubCompetition JournalPaper sequently, one of the major focuses this year the movement of the motors. Through in the design was minimizing heat-related is- pulse width modula- sues. To this end, the computer inside the tion, input from the main housing will be mounted to the alu- DreamPlug CPU could minium end cap, which will ideally serve as be effectively trans- aheatsinkanddispelasmuchheataspos- lated into movements sible into the water. of the DC motor, controlling both the speed and direction of the thrusters. 2.2.2 Wiring Given that the AUV will be fully sub- Hall Effect Sensor To avoid the high cost merged, it was imperative that all of the of a servo, a Hall effect sensor was set up electrical components were instead. By placing four magnetic sensors on protected from shorting out the worm gear and a transducer which varies due to contact with wa- based on magnetic field at a fixed location ter. Although the original adjacent to it, the degree idea was to machine water- to which the worm gear proof wire connections in- has turned can be deter- house, the team soon discov- mined. Checking the ori- ered that the precision re- entation of the propulsion quired to create a waterpoof thrusters (i.e. whether they are level, tilted seal was not feasible with the upward/downward, etc.) before powering equipment available. As a them on is, of course, crucial in ensuring the result, the team decided to AUV travels in the direction intended. purchase and use Ikelite ICS underwater con- nectors for the many areas on the AUV that 2.2.4 Input/Output Handling require a waterproof seal around the wire. Most of I/O handling was sent through an While somewhat costly, this provided much- integrated Phidget TextLCD 20x2 and Phid- needed peace of mind for the most vulnerable get InterfaceKit 8/8/8 module. This combi- parts of the robot. nation module acted as a hub for all com- ponents requiring digital or analogue inputs. 2.2.3 Motor Control In addition to commu- The two main modules that affected the con- nicating signals from trol of the motors consisted of the servo con- the computing core, the troller and Hall effect sensor, both which al- display readout on the lowed the robot fine control of the position LCD was used to indi- of the motors at all times. cate the AUV’s state as it moved through key portions of the code. Coupled with the con- Servo Controller A Phidget Advanced sole data, this provided an efficient method Servo Controller was used to control to troubleshoot the robot.

St. George’s Robotics Team 5 2013RoboSubCompetition JournalPaper

2.2.5 Spatial Recognition grates with the readings from the Phidget The main module used to determine Spatial 3/3/3, allowing for more accurate position, orientation, and direction of readings with respect to spatial perception. the AUV was a Phidget Spatial 3/3/3. This 2.2.6 Depth Sensor component combines To gauge the depth of the AUV, a Honey- an accelerometer, gy- well NSCDANN030PAUNV Pressure Sensor roscope, and compass, all of which would was mounted on board the be used in coordination to determine the robot. As the resistance physical state of the AUV. of the sensor changes ac- cording to pressure, an al- Accelerometer The accelerometer por- gorithm can be used to con- tion of the module measures both static and vert the analogue output of the sensor into dynamic acceleration in all three axes. By depth. Because the sensor had to be exposed integrating the data collected with respect to the extremities of the robot in order to to time, the AUV’s speed and position can take the reading while remaining dry so that be determined to a rough degree of accuracy. the electrical components would be safe, care was taken to ensure that only the sensor por- Gyroscope To ensure that the robot re- tion of the module was exposed, with the rest mains in the orientation intended, the gy- of the component remaining waterproof. Be- roscope on the module provides readings of cause depth control is one of the most im- pitch, roll, and yaw underwater. Corrections portant aspects of positioning the AUV, this of orientation will be made with the thrusters module was critical to the running of the in the event that the robot is incorrectly po- robot. sitioned.

Compass Although the compass module 3 Software provided with the Phidget Spatial works quite well, its inconvenient position amidst Ensuring that the code ran properly was a all of the other elec- big challenge, given the very limited testing tronics on board is li- time the team had. The programming team able to cause misread- worked intensely to get the software work- ings in the direction of ing as smoothly and as quickly as possible; the AUV. As a result, with only a few members having full knowl- asecondcompass,an edge of the API used, this was difficult, but Ocean Server OS5000-US Solid State Tilt as the team’s mission strategy for the AUV Compensated 3 Axis Digital Compass was this year was not overly complex, the pro- installed at the front of the robot, away from grammers were able to make do with the lit- the main electronics. The built-in accelerom- tle time they had. eter (used for tilt compensation) also inte-

St. George’s Robotics Team 6 2013RoboSubCompetition JournalPaper

3.1 Overview numerous platforms and systems that the The code for all of the software for the AUV team members used, a standard IDE was de- was written in C++.Inthissituation,C++ cided against. was the language of choice due to its effi- The main challenge for the team was to ciency, object-oriented nature, and relative find a way to keep everyone in tune with simplicity to debug and understand. Most what was meant to be accomplished, as there of the programmers on the team come from were numerous aspects of the software that a Java/Python background, so C++ was had to be dealt with. For instance, because asomewhatnaturaltransitionintoanar- each of the sensors relied on different APIs, guably more powerful language. it was sometimes difficult to debug code that All of code was compiled for the Dream- one team member had worked on. Regard- , running on an less, the programming team found the use of ARMv5 architecture. Because the Dream- flow charts and other graphical representa- Plug lacked the memory and processing tions of the code very useful. power to compile the code natively in an ef- ficient manner, the team decided to cross- 3.2 Programming Paradigm compile their code, storing only the binaries The programming team decided to take a on the DreamPlug system. The source code class-based, top-down approach to the pro- was written using various text editors, and gramming. More specifically, each module compiled via command line—because of the that was included on the robot would have

St. George’s Robotics Team 7 2013RoboSubCompetition JournalPaper its own separate class, thus allowing a fairly move these variations and inaccuracies. A simple means of organizing all of the code. basic Kalman filter was developed to clean The general structure of the program was up the data; however, due to time con- first created using a large flowchart. Then, straints, the algorithm more closely resem- the methods that needed to be implemented bled a moving average filter. were mapped out and placed onto the dia- gram. After the team agreed upon which 3.4 Navigation Control classes, methods, and algorithms to used, Controlling the position, orientation, and each member was assigned a different por- motion of the robot was the next task, af- tion of the code, starting from the broad- ter being able to read the data input from est tasks (e.g. instructing the robot to sub- the many sensors on the robot. The team merge) down to the most fundamental ones decided to have four fundamental methods (e.g. measuring and controlling the depth to that would govern the robot’s entire mission: which the AUV submerges). move(), goDown(), goUp(),andturn(). These four methods represent the highest 3.3 Input Processing level of abstraction for the AUV; the team As mentioned earlier, each sensor was given worked down from these four methods to cre- its own class, within the class would include ate a functioning robot that could complete methods to read and process data; since the the tasks originally set out by the mission output of each sensor had to be interpreted strategy. in a different manner, the team felt that it In programming the motion of the motors, made most sense to create a common method one of the major problems that the team among all of the sensor classes to read data. faced was the issue of determining how to Most of the sensor input went through the control the motors as it changed from one Phidget InterfaceKit 8/8/8 module, which position/speed to another so that the tran- served as a hub for both input and out- sitions could be smoother and more gradual. put. This was ideal because the InterfaceKit After some research, the team decided to comprised built-in ports on API methods implement a proportional-integral-derivative for reading both analogue and digital input controller, which would gradually adjusts the (as the sensors on the AUV outputted both speed of the motor as it approaches a desired types of data), as well as being able to output setpoint. Despite the fact that implementa- information on both the LCD display and in tion of this controller was quite complicated, the console log. the team found great success in navigating Filtering the sensor data was perhaps one the AUV smoothly after this was completed. of the most challenging problems the pro- gramming team had to face. As the data generated by the sensors was very noisy, the team was tasked with finding a means to re-

St. George’s Robotics Team 8 2013RoboSubCompetition JournalPaper

4 Conclusion 5 Acknowledgements It is clear that the St. George’s Robotics The utmost respect and appreciation goes to Team is not a bringing a AUV into the Mr. Andrew Kay, who took many hours out competition this year that will amaze the of his busy schedule to tirelessly supervise audience by completing every challenge in the team throughout the entire process, pro- lightning-fast time—far from this, in fact. viding countless tips and insight to ensure Nonetheless, the team is quite proud of what that the robot would function as well as pos- has been achieved over the past three years. sible at the competition. This robot would Myriad challenges and setbacks plagued the not nearly be where it is today were it not team throughout the entire process; despite for his undying guidance and mentorship. this however, the team has managed to pull In addition, because of the team’s very together and put together a robot that ac- limited budget, sponsors make an enor- complishes a great deal, considering the ex- mous difference to the success of the perience of the team. robotics program at St. George’s. Many That being said, the team hopes to be thanks goes to the team’s generous sponsors: very successful at the 2013 RoboSub Compe- Whealthfields Lohmann (Hong Kong) Ltd., tition. A number of improvements have al- the St. George’s Parents’ Association, and ready been planned for the robot in ensuing Stollco Industries. Their contributions have years; the team’s experience at the competi- truly helped made the team’s participation tion this year will hopefully only allow even in the 2013 RoboSub Competition possible. more ideas to transpire and come about. To the team, this AUV is more than just an AUV; this AUV represents the hard work, the everlasting perseverance, and the undy- ing vision by all of the team members for the past quarter-decade. This AUV represents the product of countless hours of brainstorm- ing, cooperation, and problem solving. More than anything, however, this AUV exempli- fies the hopes and dreams that this team has possessed ever since its team members came together. Participating in this competition has been a distant aspiration for so many years; finally realizing this dream has truly been an unforgettable accomplishment.

St. George’s Robotics Team 9