Friday, March 3, 2017

Parts is parts

There's an old joke about engineering large projects: "Q: How do you eat an elephant? A: One bite at a time."

A robot, like anything, is the sum of its parts. If I can break it down into bite-sized parts, I can solve each one, and then solve the problem of integrating them later.

I figure that the parts needed by such a robot are as follows.

Housing

I tried my hand at building my own flashlight for diving (successfully!) so I was not a complete novice. But something this large would have to be custom-built. I could not just rework a maglite.

Under the ocean at my usual diving depths there is 45lbs of pressure for every square inch of the housing, so it has to be strong. It also needs to be relatively light, machinable, and waterproof. A natural choice is some sort of plastic like PVC or Delrin. Aluminum would also work, but I'd rather not tackle working with metal until I have to.

Making the thing would lead me into the world of CNC machining at MakerPlace

Buoyancy

On first blush, it seems like you could just carefully tune the weight of the robot to weigh the same as the displaced water, so that it is neutrally buoyant, but it's not that simple. Water changes density slightly with temperature and salinity. While I have not yet encountered a halocline, I regularly cross thermoclines as I dive deep into the canyons of La Jolla. 

Some robots use active trust (motors pointed upward) to mantain vertical position, but that seemed too energy-intensive to me. A much more interesting problem would be to control it dynamically, like submarines do.

Pitch, Roll, and Yaw

Being underwater is a lot like flying, so I'd need to control 3 axes. Roll is easy - just use a keel weight like sailboats do. The weight will always keep the housing upright.

Pitch ought to be similar, with the exception that the keel weight must be movable forward and back. I'l need a 3-axis accelerometer to detect the angle of the housing, then use control logic to position the weight to achieve the desired pitch. Basically, a sensor, a motor, and a control loop - not rocket science.

That left yaw, a.k.a steering. Being a Star Trek fanboy, I figured I could do that with propulsion if I had two nacelles like the Enterprise. By applying different amounts of thrust to each side, I can steer or even rotate in place by running one motor backward.

Nacelles allow steering without a rudder


Propulsion

At the same time I was getting this effort started, Blue Robotics was just starting their KickStart campaign. I got two of the first runs of their T100 motor with an integrated speed controller.

I looked at building it myself out of sump pump motors, but when I dug into the details of how to hold out 45PSI of salt water from coming in the drive shaft, I realized I was in over my head. Finding bearings for the rotating shaft that could both rotate and be waterproof was a big challenge. Blue Robotics used a much more elegant solution.

Tracking

In the person-following project, we used image analysis to find a color blob and track it. This proved difficult as the target walked past a colored wall or into the shade, as the hues and intensities that reached the camera changed accordingly. With diving, it is even worse as particulates in the water can limit visibility and water itself blocks more red and yellow the deeper you go, eventually fading to black. And almost ALL dive gear is black. Following big black objects would be great for tracking if I lived where there was clear water :-{

At about 100ft off Roatan, Honduras

About 100ft on the wreck of the Yukon, San Diego

Deep in the murky waters off San Diego, basically everything is black. Clearly a more sophisticated method was needed.

There is a lot of work being done on segmenting images, and more recently, deep learning, but the limited visibility in San Diego led me to try something else first: sound.

Dolphins use sound to locate fish in water too cloudy to see in. I figured if I could wear a transmitter, the robot could follow me as long as the sound was directional. Multiple ultrasonic transducers, each with a narrow angle of input, should do the trick.

Collision detection

On land, hobby roboticists use sonar for range-finding. I figured if I could use ultrasonic sound to do tracking, collision detection could build on that.

Control logic

Finally, you have to have a set of electronics to tie it all together. An onboard computer of some kind, various input/output lines to the motors and sensors, and some custom circuits to do what I can't buy off the shelf.

It turns out this is the easy part. For a software engineer, writing software is like a Siren Song - it makes you feel good doing something you're good at, and it's tempting to spend all your time gold-plating the control logic and neglecting the parts you suck at. Well, at least for me ;-}. So, I promised myself to do a balanced approach.

No comments:

Post a Comment