/underwater-assembly-auv

Repository containing parts list and CAD files to retrofit a BlueROV2 for improved autonomous operation

Dartmouth Droplet AUV

Repository containing parts list and CAD files to retrofit a BlueROV2 for improved autonomous operation. The starting point would be a BlueROV2 heavy. A CAD file of the build is available here. Note that the front mounting plate is different than what is in that CAD file. I was experimenting with adding fans for camera cooling. What I use now in the robot is represented in the dxf file below.

The DXF files are usable as laser cutting patterns. The files Electronics Tray Body.dxf, Electronics Tray Body.dxf, and rear electronics tray mount.dxf are cut from 4.9mm delrin plastic from ponoko.com

The file Camera Mount.dxf is cut from 3.2mm black delrin from ponoko.

The file FCU Mount.dxf is cut from 2mm aerospace aluminum from send cut send.

The hardware for assembling the components comes from mcmaster-carr and allied electronics (for the mounting brackets). See the packing lists for both of those orders for details on the components.

Electronics

ESCs: 2x DALRC rocket 50a from here. You also need another FCU to configure the ESCs. We use the DALRC f722 dual from here

Main computer: UpBoard UpSquared here. We use the 8GB ram quad core model Main computer addons:

  • UpSquared wifi kit here used to connect to the robot when it is on the surface
  • SSD for the upboard. We use this one
  • Tiny USB 2 cable for connecting to FCU here
  • Locking but small USB 3 cable for connecting to the camera here

FCU: An Mrobotics X2.1. It is a smaller clone of the pixhawk with updated sensors. Available here. We ordered with all cable options. Essential is the bridge cable for usb2.0 connection.

Power management:

  • Blue robotics underwater switch for the relay here
  • 80A car relay. We used this
  • 2x ZTW BECs here. One powers the FCU and the other the upboard
  • 60A boat fuse here. Protects against runaway loops in control or firmware causing components to burn out.
  • 2.1mm barrell connector for UpSquared here

Camera:

  • FLIR Blackfly S U3 Model: BFS-U3-16S2M-CS: 1.6 MP, 226 FPS, Sony IMX273, Mono here
  • Lense: Stardot technologies LEN 3.5mm CS here

Other hardware

The mounting hardware order from McMaster has most of what you need. In addition to that, you need:

  • I use velcro straps rather than zip ties here. The rectangular holes on the mounting plate are designed to allow you to feed the velcro through the plate allowing you to mount custom payloads easily.
  • Aluminum hex standoffs to accomodate for the longer body plate are needed. Four of these and two of these
  • A pack of vibration damping standoffs for the FCU: here
  • Vibration damping washers for mounting below the camera. I also put these washers between the thrusters and the vehicle's body: here
  • 4 of steel corner brackets for mounting the camera plate: here
  • For my current build, I use mr30 connectors to bridge between the ESC's output wires and the penetrators. I think it would be better to use regular bullet connectors instead of these though: here
  • Upgrading to the cobalt connector-ized thrusters was a big lifestyle improvement. I use the cobalt connectors whenever I can: https://www.bluetrailengineering.com/product-page/blue-robotics-t200-thruster-with-cobalt-connector
  • I use high flexibility silicone wire everywhere inside the tube. It packs better than standard wire and is supposed to stand up better to vibration than standard wire. I used various sizes of this brand: here

Notes

  • The ESC->penetrator connections are tough to fit in. You need to solder the ESC's wires at 90 degrees to the ESC body
  • I use this brand of silica gel packet here. Because of how warm it can get in the tube when the UpSquared is churning, silica descicant is necessary in the main electronics tube.
  • The wifi setup I use as the virtual tether makes the upboard unable to connect to the internet. To make life easier I run one of these ethernet cables into the camera compartment so I can easily jack the robot into the internet. I keep an ethernet cable with a junction like this handy.
  • If you want to run the robot with a tether, you will need to find a place to put the fathom-X board (the tether interface board) and to connect it to an ethernet jack on the UpBoard. There should be a good spot for doing this below the UpBoard's heatsink on the underside of the electronics board.

Software setup

TODO flesh this out

Install SimpleSub on the FCU. The source code for SimpleSub can be found here https://gitlab.com/dartmouthrobotics/ardupilot-simplesub. Instructions for building and uploading coming soon.

Install Ubuntu 18.04 server on the UpSquared, ensuring that it is booting from the SSD and not the EMMC memory that comes with the board. Install ROS melodic.

Building & Installing the SimpleSub FCU firmware

The FCU runs a custom built Ardupilot firmware that I call SimpleSub. SimpleSub can be found here: https://gitlab.com/dartmouthrobotics/ardupilot-simplesub/-/tree/SimpleSub-v0.0.1

Clone that repository and ensure you are on the SimpleSub branch. Once you have done so, run the environment setup script that ardupilot provides by picking the right script from this directory for your OS https://gitlab.com/dartmouthrobotics/ardupilot-simplesub/-/tree/SimpleSub-v0.0.1/Tools/environment_install

After that is done, you need to reload your environment: source ~/.bashrc (if on linux)

With that, you should be able to build the code with the following commands from the ardupilot directory:

./waf configure –board=mRoX21

./waf build –targets=simplesub/SimpleSub

Adding the –upload option onto the waf build command should upload the firmware to the FCU if the FCU is plugged in to your computer via a usb connection, but this doesn’t work for me. What works is running QGroundControl and then plugging the FCU into the computer and using that GUI to upload the custom firmware. The waf build command above will put a file called “simplesub.apj” into the “bin” folder. In the QGroundControl GUI, select the upload custom firmware option and select “simplesub.apj”. This should work!

Another option for uploading the firmware that works for me is:

./waf --upload --targets simplesub/SimpleSub --upload-port /dev/ttyACM0 (I found the device descriptor /dev/ttyACM0 by looking at dmesg)

In addition it can be built and uploaded simultaneously like so:

./waf build --upload --targets simplesub/SimpleSub --upload-port /dev/ttyACM0

It looks like the issue with this was that when the device is rebooted by the firmware uploader script, it gets a different device id. The firmware uploader correctly found the first usb serial device (look at /dev/serial/by-id to find the one), but when it is booted in firmware mode, it got a different id.

This command should be easier to replicate and it worked. The first usb serial device is the one that shows normally, and the second is the one after trying to run the firmware uploader:

./waf build --upload --targets simplesub/SimpleSub --upload-port /dev/serial/by-id/usb-ArduPilot_mRoX21_3C001D000C51383437313533-if00,/dev/serial/by-id/usb-AUAV_PX4_BL_AUAV_X2.1_0-if00

Notes on setting up the wifi to allow remote wireless shell access

How to make the upboard an access point

  1. Install isc-dhcp-server and hostapd

in file: /etc/hostapd/hostapd.conf add:

interface=wlan0
driver=nl80211
ssid=bluerov-network
hw_mode=g
channel=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=BlueROV2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

in file /etc/network/interfaces add:

# ifupdown has been replaced by netplan(5) on this system.  See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
#    sudo apt install ifupdown

auto wlan0
iface wlan0 inet static
	address 10.10.0.1
	netmask 255.255.255.0

in file /etc/dhcp/dhcpd.conf add:

authoritative;
log-facility local7;

subnet 10.10.0.0 netmask 255.255.255.0 {
	range 10.10.0.2 10.10.0.16;
	option domain-name-servers 8.8.8.8;
	option routers 10.10.0.1;
	option subnet-mask 255.255.255.0;
        option domain-name "testnet.local";
        option broadcast-address 10.10.0.255;
	default-lease-time 28800;
	max-lease-time 28800;
}

start hostapd:

sudo service hostapd start

give wlan0 an ip address:

sudo ifconfig wlan0 10.10.0.1 netmask 255.255.255.0

start isc-dhcp-server:

sudo service isc-dhcp-server start

Make sure to edit the file /etc/default/hostapd and set the DAEMON_CONF value

need also to "unmask" the hostapd service

sudo systemctl unmask hostapd
sudo systemctl enable hostapd

Also make sure to edit the INTERFACESV4 variable in /etc/default/isc-dhcp-server to include wlan0

It should be INTERFACESV4="wlan0" also the file should include INTERFACES="wlan0"

In /etc/rc.local do:

#! /bin/sh -e

service hostapd stop
service isc-dhcp-server stop
service hostapd start
ifconfig wlan0 192.168.2.2 netmask 255.255.255.0
service isc-dhcp-server start

To stop the upboard from lagging at boot when no network is connected, do

systemctl disable systemd-networkd-wait-online.service
systemctl mask systemd-networkd-wait-online.service