We finally headed over to the campus pool today for our first day of live underwater testing! We have been working hard on the code to control Barreleye, and we finally had it to a point at which we could test it in a realistic environment. We all gathered in the lab and loaded up Ben’s station wagon with the AUV and associated equipment (BTW, Smart Bungees are really useful for tying stuff down as well as tethering), then made the short drive over to the gym.

Ready to go!
As we unloaded Barreleye and wheeled her down to the pool, there was a group of 30-35 people watching us through the pool room windows! We had told a few tours about our plans, but we weren’t expecting such a crowd! Alas, they turned out to be an orientation tour and left three minutes after we got there, but about four stuck around to watch.
The previous pressure test hadn’t gone too well and we weren’t really sure that the hull wouldn’t leak, so the first thing we did was send the hull and frame to the bottom by themselves to double-check our latest round of spreading silicone all over everything. We left it fourteen feet under for a half-hour, and were relieved to see only three drops of water, which could even have been condensation. With a little nervousness we lined the bottom of the hull with a thin absorbent sheet and loaded in the E-rack and batteries. We hooked everything up and sealed it with the end cap, forgetting to turn on our servos in the rush. We decided to skip all of the planned dry-testing and threw her straight into the water, very gently.

Just throw 'er in!
At first we were worried that the wi-fi connection wouldn’t work automatically and we would have to re-configure something, but the last-minute design change we had made the day before worked flawlessly. For the first 20 minutes, anyway. I eagerly launched the RC software I had written the few days before, and yelled at Joe, who was in the water next to the AUV: “We’re going forward!”. Barreleye sprung to life and smoothly powered her way forward.

Forward motion!
“Try going down!” was Joe’s reply, and I traded the forward thrusters for the vertical one pulling down. I waited a few seconds after maxing out the control, and yet again heard Joe yell “Try going down.” “It is!”, I countered, and we both saw the large ripples on the surface created by the vertical thruster trying its hardest to make the AUV descend, and obviously displacing a lot of water while it was at it. Yet as hard as it tried, she was still sitting on the surface. I shut it off, and Joe and Stephen tried adding a little bit of lead ballast to make it easier. We very quickly noticed (well, they did anyway), that we were no longer positively buyant! She was sinking!

Thar she goes!
An 0.8lb weight had succeded where a $900 thruster had failed. Something is wrong here! We knew that we have to end up positively boyant (i.e. not sink by default), so they removed the weight. Instead of going down, we tried driving around on the surface for a while. Going in a particular direction proved to be difficult, but she had no trouble blasting from one end of the pool to the other. Slightly encouraged, I tried combining forward and downward motion. Slowly she eased below the surface, and continued to drop as I kept her going forward. I stopped, and slowly she surfaced (say that five times fast). I quickly discovered that the best way to go under is to try to go backwards and down, because the heavy end cap tends to angle the hull back, and is thus tends to hydrodynamically drive the whole thing down when driven in reverse. Once we figured out how to get her under, the first thing we tried to do was make it through the validation gate.
I started Barreleye about 20ft from the gate, and eased her into a forward dive. Course correction proved to be difficult, because the controls and the AUV’s momentum worked against each other. After over-correcting enough to end up going in exactly the wrong direction, I slowly turned Barreleye around and tried again. This time I was able to keep her in a straight line until I got to the gate, and about a foot underwater when I got there. By that time, however, Joe was directly in the path and I cut the thrusters to avoid a collision. This proved to be a mistake, because we surfaced directly under the center joint of the validation gate, which came apart and promptly sank.

Get out of the way! Oh wait...
Not discouraged by our path of destruction, we decided to aim for the “flare” instead. The red buoy is moored with a 18lb weight and floats about four feet under the surface. At this point I decided that it would be a good idea to get a video stream from the camera (the “eye” part of “Barreleye”), and managed to get a dozen frames or so before crashing my remote connection. After a quick re-connect I tried to go at it by sight: a difficult task because of the surface distortion (note to self: get a waterproof laptop so I can control it underwater). After several failed attempts, I finally managed to slowly bump into the flare, and even wrapped the safety rope around it. We all celebrated and grabbed some lunch (which my Dad very generously provided), and then wanted to try out some of our PID controllers.
PID, for those not in the know, stands for “Proportional, Integral, and Derivative”, which are the three terms in an equation that is supposed to make our software know how to make our AUV go in a straight line. Stephen had created some code using Simulink and we had downloaded it to the AUV computer the night before. I launched the program, and we yelled at Joe to hit the “On” button (I had decided that it was a good idea for the person in the water to have control over the software. Unfortunately, it left me powerless to start or stop it). After Joe found and pressed the button, Barreleye immediately started spinning in circles. I was monitoring the compass reading and I could clearly see the number falling quickly from 360 to 0 and starting over again. “It’s going in circles!”, I yelled to Joe. “I can see that!” he yelled back. “Where’s Stephen?” I yelled at no one in particular. “Eating lunch.” said Ben as he sat down next to me with his sandwich. “Stephen!” I yelled at Stephen, who was enjoying his sandwich on the steps in the corner of the (very large) room. “Your code isn’t working!” No response. After several attempts and a few amused looks from Joe, we got Stephen to join us under the diving platform and discuss his algorithm. We tweaked some gains for a few minutes and got Barreleye to spin in circles slower, and even to oscillate in wide arcs around the desired heading. All of us eventually figured out that she was overshooting the mark, and was trying to go all the way around again each time. We knew that the way to fix that was to adjust the “Derivative” part of the PID controller, so we tried to adjust that gain value. After a few minutes of searching, Stephen and I realized that we must have left that part out of the code somehow! All we really had was a PI controller, and not a very good one at that.

This story is so long it needed an intermission. Here you go.
Another half hour of spinning in circles and yelling “hit the Go button!” and “Stop it!” at whoever was in the water at the time, and our time was up. We only had 20 minutes left before we had to vacate the building, and right on cue, the main computer batteries died. We hurried to get her out of the water, because we knew that the system could quickly drain the batteries past the point of no return, and our off switch unfortunately doesn’t work after the voltage drops too low. I popped off the end-cap, we quickly removed the batteries, and we packed everything up for the return trip to the lab.
After a hard afternoon’s work, we now know exactly how she handles in the water, and more importantly, that we can’t drive in a straight line, or even go underwater without some hydrodynamic trickery. We have a long way to go, and not a lot of time to get there. Unlike last week, however, we know exactly where we are, and what we have to do to get to where we’re going. Wish us well!