7.31.2015

Designing RoboGoby's PCBs in Eagle

To make our lives easier we decided to design our own custom PCBs (printed circuit boards) to use in RoboGoby, instead of stripping wires and soldering to prototyping boards. We decided it would be more efficient to design our PCBs in CAD and then have them manufactured for us. Not only does this help remove a lot of clutter inside of the watertight compartment, but it also makes our product look and feel more professional. To design the boards we used Eagle. After designing the boards we used OSH Park for manufacturing.

We started designing the PCBs after we had chosen the sensors and processor for RoboGoby. Due to the number of sensors and controllers we're using in RoboGoby, we needed to make three different boards to accommodate everything while still fitting inside of our aluminum body. The boards are connected via stackable pin headers and ribbon cables. Below are quick descriptions of each board along with a CAD photo.

PCB1 - Micro and LED Control

This PCB houses our LED controllers, main micro controller, and screw terminals. You can see the 4 LED controllers on the left of the board and the place for the micro controller on the right (right above the words RoboGoby). The other pinouts are for attaching stackable headers and screw terminals. The screw terminals will be used to connect our cabling which is routed through our cord grips in our watertight compartment. This type of connection allows us to still be able to remove the wires (by loosening the grips and then just pulling them through) rather than having to solder/unsolder plug connectors in order to pull the wires through the grips.

PCB1 (.brd file)

PCB2 - PWM and Pressure

PCB2 is sits underneath PCB1 and contains our PWM controller and ribbon cable connectors (which connect to PCB3). The 2x3 ribbon cable (upper left of board) is used to transfer power from the electronic speed controller (ESC) battery elimination circuits  (BECs) - routed through PCB3. The 2x5 ribbon cable (bottom left) is used to transfer the signals from one PCB to another. This PCB also has outputs for powering our main processor, the ODROID-XU3 and a sensor mount for our interior pressure sensor. 

PCB2 (.brd file)

PCB3 - ESC PCB

The last PCB we designed is our "ESC PCB". This PCB has a few key functions. It is used to route the PWM input to the motor controllers and also utilize the 5v output from the ESCs onboard BEC. It also houses the current sensors for each of our motors as well as a humidity and temperature sensors. This PCB is not stacked, but sends power and receives data instructions via the two ribbon cables. An image of the Eagle 

PCB3 (.brd file)




Board Layout

In order to layout the pins on our boards and figure out the size requirements we used SolidWords. We made designs for each of the PCBs and holes where each of the sensors were going to go. After laying everything out in SolidWorks transferring the PCB to Eagle was easy – we just had to steal the dimensions from solid works and then route all of our connections. Rough pictures (not 100% accurate – screw terminals were reversed) of the CAD are below:



Stack PCB1 and PCB2




PCB3

The finished boards will be arriving soon so stay tuned for a post about PCB construction!

7.27.2015

Watertight Compartment – CAD Model

One of the most integral pieces to our new sub design is a watertight compartment. In our previous design, RoboGoby Version 1.0, we decided to avoid the difficulties of making our own watertight compartment by potting all of our electronics in epoxy. While at the time this seemed like a good idea it ended up being a big problem for us. After epoxying our electronics we couldn't access anything which meant it was harder to debug our system and to add to our platform. Based on this experience we decided to make our lives easier this year (and in the long run) by designing our own watertight compartment. The two key pieces to our compartment are the machined aluminum pieces and the watertight connectors.

Machined Parts

At first we struggled with the type of seal we were going to use for the compartment. Although we knew we wanted to use an o-ring seal, we wanted something that would give us the largest opening into the watertight compartment and keep it within the 5"x5" size of our sub. Our first thought was to use an axial o-ring seal. While this seal is effective, it takes up too much room for a number of reasons. First off this type of seal needs constant pressure around its circumference which means we would have need 8+ bolts to create a good seal. Secondly, we want to use a double seal to ensure our compartment doesn't leak – with two axial o-rings the access opening would go under 3.5", which is too small to be useful. While talking with one of our mentors, Jon Amory, he mentioned the idea of using a radial o-ring seal. This design would follow the form of our sub better (it is longer not wider) and therefore would allow us to have both a larger access hole and a double seal while still fitting inside of our 5"x5" constraint.


Radial Seal (Apple Rubber)
Axial Seal (Apple Rubber)



















To design the aluminum fittings we used Apple Rubber, an rubber engineering company. They have a great introduction to o-ring design (static o-ring seal descriptions found here).

On one end of the compartment, the access end, we designed a plug and a plug housing. The plug is made out of a 4.75"x4.75"x2.5" piece of aluminum. The plug itself acts like a cork to keep the air in and water out of our compartment. The inside of the plug is hollowed out and has holes for running wires through. One side is square to match the interior of our sub body. An image of the plug is below. If you look close enough you'll also see a radial hole in the pocket -- this is for a bolt we will use to pull out the plug, a necessary feature because it will take a large amount of force.


Plug
The plug housing is a also a 4.75"x4.75"x2.5" aluminum block with a pocket  diameter of 4" cut all the way through the material. It also has four mounting holes on one of the faces to accept the 6mm bolts that hold the plug in place. There are also four bolts on the exterior (two on each side) which are used to hold the sections together. An image of the plug housing is below:

Plug Housing

And  the two fitting together (with a transparent plug housing):


Assembled Seal

The third, and final, piece is the back plug. This part covers the end of the watertight compartment that will never be opened. It is made out of a 4.75"x4.75"x2.5" piece of aluminum. It has a large square pocket 2.25" deep and 3.25"x3.75". The plug housing has such a large pocket to give us more room inside of the watertight compartment for our electronics. Similar to the plug housing, the back end of the compartment has four bolt holes (two on each side) to connect sections together. Below is a picture of the part:

Back End

We will be welding the parts to our 5"x5" sub body to finish the watertight compartment. The aluminum parts slide into the compartment about .5", more than enough room to hold it in place while being welded from the outside. A picture of the finished compartment is below:

Watertight Compartment





Watertight Connectors

As you probably noticed, the pieces talked about above have holes through them. These will in fact be used for routing the wires inside of RoboGoby. The five larger holes on the back end plug and the plug itself are holes for cord grips which will keep our electronics sealed off (read more here). The 6th and final hole, which can be found on the plug, is a threaded hole for a Presta valve. We are going to use the valve to pressurize the compartment to relieve strain on the o-rings and quickly alert us of any leaks in our housing (when combined with a pressure sensor).

Plug Assembly w/ Connectors

7.26.2015

Connectors and Cord Grips – Waterproofing our Wiring


One problem with having a waterproof chamber in our submersible is finding a way to get wires in and out without compromising the seal. We have three separate measures that we are taking to make sure that all of our wires are waterproof: we are using five cord grips, a waterproof 3-pin connector, and strategic epoxying.



Cord Grips:

Cord grips allow us to have wires penetrate the waterproof compartment without having to worry about letting water in. We bought submersible cord grips from McMaster (pictured below) and incorporated them into the design of our watertight compartment.

Submersible Cord Grip


As you can see in the picture the back end of the cord grip is threaded which allows us to easily incorporate it into the plugs for our waterproof chamber. Because we are getting the plugs professionally machined we can be confident that they will be tapped correctly, meaning that with the addition of some Blue Loctite the threads will be waterproof to a few hundred feet. Lastly the inside of the cord grip has rubber pieces that tighten around the wires to ensure no water gets past.



Epoxy:

While the cord grips take care of most of the possible entries into the waterproof chamber it leaves one - water that gets inside of the insulation of our wiring and travels through the wire itself and into the chamber. To keep this from happening we will epoxy the endpoints of the wire on both the outside and inside of the waterproof chamber so that even if one is to leak a little the other should keep the water at bay.



Waterproof Connector:

The last piece in our waterproofing system is a waterproof connector. We are using one of these outside of the submersible as a way to easily attach/detach the tether from the submersible. We spent a long time looking for connectors that are actually submersible and not just waterproof as we ran into a few common problems. In a majority of cases connectors are rated as IP67 or IP68, neither of which are submersible (IP68 is submersible but usually only to shallow depths and for limited time, for more look here). When we did find connectors that seemed like they were suitable they were often from large suppliers that only fulfilled orders of hundreds or thousands.

Eventually we found a supplier that has their parts carried by Digi-Key which allowed us to buy individual connectors. The connectors are made by Souriau, this is the catalog we used to order parts. We got a 3-pin connector and 14AWG contacts (which are bought separately from the casing) - specifically we are using the 142G1 series.

142G1 Connector

Instead of having a connector attached to the outside of the body we decided to have a few feet of tether permanently protruding from the submersible. This is because we are not sure how much strain the connectors can take without becoming compromised. Instead the place where the tether enters the submersible is braced with another cord grip as we know that can take a lot of strain.

7.25.2015

Change of Processor – Beaglebone Black to ODRIOD–XU3

About one month ago we decided to change our main processor from the BeagleBone Black to the ODROID-XU3. ODROID stands for Open-Source Android, and is a powerful embedded linux platform. Although the XU3 is more expensive and larger, it is much more powerful than the BeagleBone. In order to run our high-level stereoscopic camera we needed a faster and more powerful computing platform. Some of the specs are below:

      • 2.0GHz Quad-Core CPU
      • 2Gbyte of RAM @ 933MHz
      • eMMC

All of our other computing for our sensors and motor control will be still be done by a smaller micro-controller which we will connect to the ODROID. A stock photo of the ODROI-XU3 is below:


ODROID-XU3


7.20.2015

Compiling a Linux Kernel for DUO3D Arm Module/Driver

As part of their developer program ($95 per year @ https://duo3d.com/program/developers), Code Laboratories provides a kernel level driver source for their DUO cameras that can be compiled on an embedded Linux kernel. This compilation produces a .ko file that can be inserted into the kernel (the level of the operating system that handles communication between the user and the user interface and the actual physical components of the system, such as the DUO camera and USB drives) to drive the camera on almost any embedded Linux device (although only some are powerful enough to run the camera). Here, we will go over the general method of compiling these DUO drivers, although I will be using the Odroid XU3, one of the boards that Code Laboratories recommends. It is important to note that, in our experience, boards like the Beaglebone and the Raspberry Pi, while useful in their own right, are not powerful enough to run a DUO camera in any useful capacity. We recommend using the Odroid XU3 as it is the smallest of Code Laboratory's recommended boards or another of their recommended boards, like the Nvidia Jetson.

After applying for Code Laboratory's developer program, you should be able to download a from your account page a special package of DUO software for arm under the section DUO Developers. Store this in your user profile folder (/home/[user] or simply ~) on your Linux device. Inside the folder should be a readme file with specific instructions on how to compile the driver for the Nvidia Jetson. These instructions are pretty close to universal, but not quite.

The next step is to get the latest kernel source for your device. Many companies, like Odroid, distribute custom kernel sources for each of their devices (the Odroid XU3 Linux Ubuntu source can be found here: https://github.com/hardkernel/linux/tree/odroidxu3-3.10.y and can be downloaded using the command:


git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidxu3-3.10.y

in the directory in which you want to download it [we recommend ~ also]). The latest Linux kernels can be found here 


Make sure you get one that is right for your device. This may require using google on your part, but any documentation for your device should include a location for the kernel source. Once you have the source, take a look at the readme provided by Code Laboratories (CL). you can largely ignore the prerequisites as most systems embedded have GCC compilers and debuggers. You also don't need QT, Cmake or opencv unless you are planning on compiling CL's examples. Start by following their example and cd-ing into your kernel source directory, which, if you used the command above to get your kernel, would be 

 cd odroidxu3-3.10.y

You now have to configure your kernel. The kernel has thousands of configuration files for different systems. For the Odorid XU3, you can use make odroidxu3_defconfig to configure the kernel. Otherwise, you can look for a similar command for your own kernel online or use make menuconfig or make oldconfig to configure manually. 

Next, follow steps two and three as laid out by CL's readme. You don't have to use gedit to edit the file you are patching but can replace it with "nano," a more common but less robust utility, and then use ctrl + W to search for the lines they want you to comment out.

Now you're ready to make your kernel. Enter these commands in succession, waiting for each to finish (which may take a while) before entering the next. NOTE: the -j switch specifies the number of cores you wish to use while compiling the kernel. The number you pass it is 1 + the number of cores you want to use. The Odroid XU3 has 8 cores, so use 9 for the maximum compilation power.

make zImage -j9 

make modules

make modules_install

Before you do anything else, check the output of the command uname -r and record it. This is your current kernel version and you will want to check if it has updated. Now follow the last command in step 5 of the CL instructions to copy the newly generated zImage from the kernel source to your devices boot directory. Before you do this, you may want to do some searching to make sure that this is where you need to move your zImage (it sometimes depends on the device or on the version of the kernel). 

Now restart your device and again execute the command uname -r to check if your kernel version now matches that of the one you downloaded and patched. If it does not, you may have put the zImage in the wrong directory. 

Next, cd into the DUODrivers directory in the file you downloaded from CL. There are three files of interest: InstallDriver, LoadDriver, and UnloadDriver. Run the command: chmod +x targeting all three of these files, then ./ the first two to load your driver and ensure that it loads whenever you start your device. To check if it has loaded, verify the duo0 node is in the /dev diectory and run the command  lsmod to list active modules. Look for the duo module there. If this all checks out, you should be all set.

Finally, make sure you copy the libDUO.so library into the /usr/lib directory as the linker needs to know where this library is at run-time.

And that's it! The kernel is now compiled. 

7.16.2015

Lighting – CAD Model

The lights in our newly designed submersible will hopefully look much nicer than previously. Our previous lighting solution was a little ugly and didn't work well in practice. The problem we had faced was fitting the LEDs, three cameras, and all the mounts inside of a 4" diameter PVC pipe. The switch to a 5" cuboid makes mounting the lights much easier. It not only gives us much more room, but also makes for an easier mounting surface.

Below are the three major iterations that the new sub's lighting design went through. The last design is the one we decided to use.

Version 2.1

Our first idea was to mount the lights on strips across the top and bottom using acrylic and aluminum.

LED Slabs

The problems with this idea were numerous. It limited the space for the camera and greatly diminished the angle of illumination from the LEDs. It also increased the coefficient of drag when moving forward because flat plates are much worse than either domes or cylinders. Having three lights in one packages also made each of the light slabs $100 which would make replacement costly. The only pro was the ease of production. After weighing the pros and cons we felt there was enough reason to revamp the design.

Version 2.2

After discussing a few other ideas we settled on this design. This design (pictured below) incorporates the LEDs and heat-sinks into the form factor of the sub. This gives us all of the function of the previous design, while illuminating much more space.

LED Heat-sinks w/ LEDs

We decided on grouping the LEDs across from one another. We have one set of lights centered, two sets aimed downwards, and one set aimed upwards. The decision on the placement of the LEDs stemmed from three places. The first is that we wanted to have at least one set looking almost directly forward to ensure enough light for navigation. The second was that we wanted to save some money and have 8 and not 10 total LEDs. Thirdly, due to the last two constraints, we decided to have two sets facing down and only one facing up because we expect users to spend more time looking down at the sea floor rather than the surface of the water.

We then had to create a case for the LEDs. Our first idea was to mount them directly to the heatsink with epoxy so that they would be completely waterproof. Unfortunately this solution is not very good for replacing burnt out LEDs, as we would have to replace both good and bad LEDs as well as the entire heat-sink.

Our solution was to make a separate case for each LED. The first case design had four sides closed by a 3D printed piece of plastic. The fith side we left open and the  sixth side will be made from a 1/16" piece of aluminum to give us a larger area of contact between the LED and the curved heat-sinks. An important aspect to this design was a 12mmx12mm PCB for our high power LEDs. This small PCB allowed us to make the cases small, but we still ran into problems. If you'd like to read more about our small PCB adventure read this post.

We went through a few different version of the small 3D printed case. Below is the old design we used to test the printer accuracy with:

Old 3D Printed Case (4 sides)
Entire LED Module (old)


We then moved onto the real print, only changing few parts of the case. The changes we made were closing the 5th edge of the case and curving the mounting edge to better fit the form factor of the aluminum heat-sink. The light, however, fits the same into the case.


Updated LED Case

Although this design is effective, it is costly and time consuming. We have to buy 8 LEDs are re-solder them onto the correct size PCB.  The aluminum is also expensive and time consuming to make. Therefore we decided to work on a third and final light design. 


Version 2.3

Our third design uses only 4 LEDs and takes advantage of the rotation of the camera by mounting to the same servo as the camera. We originally decided to stay away from this type of light setup because of the reflection back into the camera, but when using bent polycarbonate the light is not reflected back into the camera (this has been tested empirically). We also kept the LEDs on the star PCBs they come on, sinking them into a piece of aluminum (in the future we will buy the individual LEDs, but as we said in this post, it wasn't an option this summer). Below is an image of an LED module. 


LED Array

We then mounted the array above on either side of the camera using 3M bolts (refer to this post for color scheme).


Lights Straddling Cam


This is the design we finally settled on. Not only does it provide ample light for our camera, but it allows us to minimize the size and cost of our system. By allowing the lights to rotate with the camera we keep our illumination at a maximum while keeping our design simple. Stay tuned to find out how the building of this section goes! 

7.13.2015

Lighting – LEDs, PCB Design and Testing

One of the most important parts of our original LED lighting design was size. While we were purchasing small LEDs, they all came pre-sldered to large PCBs (Printed Circuit Boards) to allow for ample surface area for heat-sinking. After choosing to use the these high-power IR LEDs from LED Engin, but they're not available from any distributor until the end of the summer. Because of our time constraint we decided to use the same LEDs, but to purchase the ones already mounted to a PCB and unsolder them. Using the schematics we designed this PCB in Eagle (PCB CAD software):

Eagle Design


After designing the PCB we used OSH Park to fabricate them. The turn around time is about 12 days and the quality is decent. Below is an image of what the top side of the finished PCB looks like:


OSH Park PCB

Because we still wanted to use our custom PCBs and the 12.4V 10 Watt LED Engin LEDs, we needed to unsolder the LED from the manufacters PCB. We used a toaster oven to unsolder the LEDs. Below is our toaster oven:

Toaster Oven


The unsoldering process took longer than expected because of the high temp solder the manufacturers used on the PCB. This meant we had to max out the oven for 5+ minutes to unsolder the lights. Although this was longer than we wanted, we ran with it. After unsoldering the LEDs we then used a Bismuth based solder from Digikey. This stuff is AWESOME and worked extremely well for us. It's perfect for LEDs surface mount soldering because the entire oven never has to get above ~150C – over 100C below the max temperature rating on the LED.

Below is a picture of the different stages of the LED process. On the left is the original LED/PCB combo. In the middle is the LED unsoldered from the PCB. On the right is LED soldered onto our custom PCB.

LED Process
Putting Solder on PCB
LED being Soldered to Custom PCB in Toaster


And here is a close up of the final soldered LED:

LED+PCB



Although the soldering was smooth, the unsoldering process was not. Because of our lack of knowledge we were unable to unsolder an LED without burning out the diodes in the LED (because we had to have the LED in the oven 5+ minutes near it's maximum temp rating). We decided to stick with the original Star PCBs for the sub this summer. It saves us a lot of hassle and money. In the future (when we can buy the LEDs not connected to the star PCB) we will change our lighting design to incorporated this small, more effective PCB.

7.05.2015

Camera & Front Sensor Mounts

Camera Mount:

The camera mount is made of four distinct pieces. There are two parts that hold the camera system in place, the servomotor motor mount and the bearing mount. The other two parts are the shaft and camera mount.

Below are the two side mounts. One side holds the servo motor and the other side acts as a bearing for the shaft which the camera is mounted to.

Servomotor Mount
Shaft Bearing Mount






We thought about putting a bushing in the hole instead of using the plastic support as a bearing, but we decided against it as the printer plastic is quite slick.











The third part is the shaft on which the camera rotates. The white piece on the end which attaches to the servo motor is a servo horn that comes packaged with the servo motor. The shaft has a large mount connected to it. This makes a "shaft extension" that has three main functions. First, it has holes which attach it to the white piece on the servo, holding the piece to the shaft. Second, the two holes on the bottom are to hold the camera case to the shaft. Third the four top holes and two half circles are a LIDAR mount (see below).

Shaft Side View

Shaft Isometric View

The final part of the camera mount is the camera case itself. The case will be filled with epoxy, which is why there is a front as it makes it easier to keep epoxy off of the lens. The hole in the top is for the USB cable, which we are using to communicate with the camera board. 

Camera Case



Integrated LIDAR Mount

Our front facing LIDAR is attached to the camera system so that they tilt in conjunction with each other. As mentioned above the mount is part of the camera shaft mount. It consists of four bolt holes to attach the sensor and two arcs for the circular "lenses" to rest on. 

LIDAR in Mount





Entire Camera & LIDAR Mount






--------------------------------------------------------------------------------------------------------------------------

UPDATE (7/13/2015): A New Camera Mount

After finalizing the design for out lighting system we needed to change a few things on the camera mount (but kept the sensor mount). Using the same basic idea we consolidated the pieces from the previous mount and cleaned things up a bit.

We kept the same basic design for the shaft mount as above, but added a camera case to it. While this definitely stressed the 3D printer to its maximum ability, we thought it was important for a simpler design. This piece is mounted to a rotating shaft (controlled by a servo) and then mounts to the front facing LiDAR, the stereoscopic camera, and the IR LEDs. It can be considered one of the most important parts of the sub design. An image of the mount is below:

Camera + LiDAR + LED Mount

The face piece to this design is also very important because it holds LED mounts. This piece is made out of Delrin for extra stability. The large holes in the plastic are for the cameras, the medium sizes holes are for 3mm bolts, and the small holes are for 2mm bolts. 

Cam Cover and LED Mount


We also changed the Servo Mount and the Shaft Bearing Mount. These new mounts were incorporated into the half-circular mounts that replaced the LED heat-sinks (changed with lighting design change). The updated mounts are pictured below. The one on the right is the servo mount as well as the right hand cover. The left has the shaft bushing and acts as the left side cover.

























Then using these mounts and putting everything together we get the final assembly for the front of the sub:


Front Mounts&Sensors


As you can see this design not only has less pieces than the other design, but it looks much better overall.

--------------------------------------------------------------------------------------------------------------------------






Front Sensor Package

Just behind the camera and in front of the foremost thruster we put a pack of sensors. The pack consists of a depth sensor, an IMU and a downward facing LIDAR. The IMU is on the central axis of the sub and the depth sensor is just in front of it - there is also a track we will use to route wires. The hole and bolts for the LIDAR are on the left side of the sub (right side of the image). The LIDAR sticks out the bottom of the mount so that it is flush with the bottom of the submersible body.


Front Sensor Package

And this is a picture of both the camera mount and the sensor package mounted in the front of RoboGoby:

Camera and Sensor Mount