team yeah buoy
To do this, I wrote some very basic Arduino code to manage the electronic speed controllers (ESCs).
The code basically let me command thruster speed from my computer.
(computer → Arduino → ESC → thruster motor)
As our school pool was on a restrictive reservation system (thanks covid) that made it hard for everyone to access, I invited everyone to my apartment pool for testing!
After testing, we compared our data with the manufacturer’s. The left image is BlueRobotics’ provided PWM-thrust curve, and the one on the right was our own.
Though we had no reason to believe otherwise, we were heartened to see results following expected trends! Our maximum forward and reverse thrusts reached 95.2% and 71.2% advertised values, respectively.
Thus demonstrating importance of testing / benchmarking! - if we had used the datasheet values in our controls model (later) instead of experimentally recorded ones, our system behavior could have been wildly off.
Continuing the electrolysis explanation from before (see my annotated CAD above):
In electrolysis, when voltage is applied to a metal cathode and anode, the energy input breaks water into hydron (H+) cations and oxide (O^2-) anions. The negatively charged anode donates electrons to the hydrons to form completed hydrogen gas, and the positively charged cathode ‘steals’ electrons from oxides, allowing them to form oxygen gas.
A proton exchange membrane allows ions to flow through and reach their respective electrodes, but prevents gas from permeating - effectively acting as an oxygen/hydrogen barrier so that both can be harvested separately!
To collect and measure gas, I borrowed an idea from Gen Chem! We would use two inverted graduated cylinders to to collect hydrogen and oxygen separately, with the increment markings making for easy data collection.
Here you have the usual sketch → CAD → 3DP workflow process.
A quick bedroom test showed everything worked well, so…
Using an Arduino, we beakered in water and read sensor outputs every couple hundred of mL.
We plotted this data and used it to verify that pressure and depth readings matched volume- and geometry-predicted values.
We shopped around online and bought a 30” diameter, 60” tall tank, originally meant for solar water heating systems.
The tank’s translucency would be invaluable for testing, without being prohibitively expensive like clear extruded plastics would.
We simply filled the tank with a garden hose and used an aquarium pump to drain it for storage.
We got the two end plates machined from steel stock, but realized during testing that water leaked in through the mounting holes. So we remade the plates with an o-ring to seal things off.
My original design had used aluminum for all external body components, both to avoid excessive weight and to prevent rust. I think there was a miscommunication somewhere along the line, as steel stock was purchased instead.
Despite my fears of this setup being too heavy, we decided to try it anyway. We used a Johnson saw to chop the pipes to size (the seam in the leftmost picture was a mistake cut that I had to re-weld), and add the angled cut!
To mount the thrusters to the threaded rod cage, a teammate water-jetted some brackets out of 1/4” steel, and I welded them up.
However, as I wasn’t too happy with how they turned out, I asked for the pieces to be remade with alignment notches. You might also be able to discern the mounting method from this pic! The thruster mounts to four holes on the rectangular piece, and the large circular holes slot over the threaded rod and are held in place by opposing jam nuts.
With the improved alignment tabs, I was able to weld worry-free! Just a few tacks in the photo, not a full weld-out yet.
In the meantime, we also worked on gas management - methods for storage and rejection.
As we had settled on inflatable sacs (balloons), we needed a way to attach them securely, and be able to pressurize them without losing gas.
We had been using syringes and elastic bands during testing, so we replicated that geometry in a resin 3DP part. We made sure to include a nipple for the pneumatic tube as well. With this system and a few one-way check valves, we were able to inflate the balloons using only the fuel cells, and no additional compressor / pressurizing element.
Next, we prototyped and printed a new, stackable fuel cell mount design. These could be bolted into the existing underwater enclosure end pieces, as well as to each other, in case we ever wanted to do a larger vehicle. This modular design made scaling the number of fuel cells very easy.
From left to right:
An Arduino Mega hiding under a Shield with power electronics,
Our end plate, finally populated with cables and hoses. For the most part our electronics just free-floated inside the vehicle casing. We were definitely running low on time at this point, and you can see that reflected in our wiring ¯\_(ツ)_/¯
A poorly-framed picture (my bad) of the plate exterior, and its various cables running through waterproofed penetrators.
To control the craft, we had initially hoped to use PID (Proportional-Integral-Derivative) control, and drew up some Simulink block diagrams to simulate BCD behavior.
The left and center diagrams represent the thruster and gas systems, respectively, and the right was a simulation of the AUV’s depth position as it would travel to and settle at a depth. We ‘optimized’ (lol) using trial-and-error to find values that would yield the quickest time to target and the least amount of oscillations / bobbing, to eventually import into our Arduino code.
However, we eventually settled on separating the control schemes into PD control for the thrusters, and a simple on-off scheme for the fuel cells. It was very late in the semester and we thought this the most realistic solution given our timeline.
Also, huge credits to Electronoobs (in particular this video) for being a great resource on actually implementing control laws in microcontrollers. Despite the many controls problems we did throughout undergrad, we were never taught any programming implementation - a huge flaw in the curriculum if you ask me.
Here is a quick test of a simple P (proportional) control law, before we added in the derivative portion for full PD control.
We used an ultrasonic distance sensor as a stand-in for the depth sensor for testing on land, as the operating principles were the same.
Basically, the farther the sensor data deviated from a target value, the harder the thruster would compensate to return the system to that value.
In any case, our test trials with this setup were successful, so I suppose there was nothing to complain about.
Although I do think this was an instance where the numbers happened to work out - our thrusters were strong enough for our particular vehicle, and we didn’t test any extreme angles.
We were lucky this was only expected to work as a proof-of-concept in a test tank; it probably would have toppled in any open body of water.
Here is a video we took of the gas system as installed in our vehicle.
Going through a full gas generation fill cycle, and then venting all of it through the solenoid valves!
Here are some clips of our final testing.
TL;DR: All systems were go, PD control successfully brought our vehicle to set depths and held it there, as the BCD balloons filled to match.
YUS!