Home        Store        Docs        Blog

NodeROV - NodeJS / HTML based control software

(Thorleif) #1

Introducing NodeROV - ROV Control Software in NodeJS

Hello Guys! As I’ve had the ROV for a year and still not had a drop of water close to it because the software was a “pain” for the ROV. I did not like how it looked, how it worked and everything. So my journey started to develop my own software.

I found NodeJS as a suitable platform and started developing. Currently I’m ready for a “test” dive when I get my ROV packed and stuffed again.

I had to modify the ROV a bit to make this work, I 3D printed my own “Sensor Board” and used a PWM Driver & 10DOF from Adafruit connected with i2c to the Arduino.

Here you see V1 of the board mounted…

Now when i started assembling this board and putting the RPi onto the mount holes i saw a problem. The left part of it are offset a bit and hits the acrylic tube! A bit of screaming later I started designing a new version putting the PWM driver in the middle.

Tada, V2

V2 Mounted:

Oh well, since i dropped the Pixhawk i had to find an alternative way to read current draw + voltage. After hours of searching for an “i2c enabled current and voltage sensor” i gave up. There are none? If there is please refer me to it so i can buy one and maybe replace my hacked one! :stuck_out_tongue:

And as I said “hacked” here is my hacked version of an i2c enabled power module:

This consists of a power module for APM / Pixhawk (18V 90A) and an Atmega328-PU configured with 8Mhz internal clock and a software that reads, converts and stores mAh, Voltage and mAh Used onto memory and works as an i2c slave to get the data to the Raspberry pi.

Currently I have it all benched, connected up and run a test on my software, visit this link to see video of my software:

Explaining on that video you see how my system is build up, this is all HTML5 and Canvas based, video transfers over TCP protocol with frame skipping (kinda like UDP). Video is transferred as RAW h264 data and the delay i measure over 2.4Ghz wifi is about 250-300ms - Hoping its a bit less over cable. (For the record, I’ve also tried this over mobile network 4G and it was about 200ms delay there. I made a remote controlled car driving on NodeJS over 4g. Unlimited range as long as i got 3g/4g coverage! hehe).

See video of latency test: http://link.jepb.no/jOGB

I have not filled in every fields on the GUI since I have no idea on what to put in there. Also the software is not very well polished, unless someone jumps in helping me developing its gonna be a bit unpolished and not-customizeable. I was hoping to make a “settings” menu to set the PWM pins to motors, reverse pwm pins, button mapping on gamepad controller e.t.c…

Might come as I try to develop.

Also i need to work on a better vector thrust calculation. Currently I’m using one i found on a openrov forum by Rustom i think?

See below:

Hoping to enhance that to work better.

For now, nothing more to tell you about but I might update as i go! :slight_smile: Any tip is also welcome.

One cool thing would be if anyone made an shield for the arduino with all the components needed internally, and connectors to connect either PWM or i2c enabled ESC. That would be epic, i2c enabled ESC’s would work 100% on the RPi without any drivers. dreaming :stuck_out_tongue:

(Thorleif) #2

Making progress. Never thought I would get so far so fast. The GUI is currently working mostly. I am getting sensor data but I have no idea on how to convert stuff to degrees / heading. So currently it is without that.

The buttons explained: Most of them are self explainatory. “RECORD” start saving the video locally on the ROV, the 3 at bottom are used for fast logging of actions.

Also build a 9V battery with XT60 connector case I 3D printed. This is to insert into the battery chamber and do vacuum testing. When I start pump out vacuum my software recognizing a drop of pressure internally and starts an automatic “vacuum test” program. It tells you to continue pumping until you reach 4PSI then it turns over and say to stop and it counts to 15 minutes to check if its tight. My setup leaked 0.3PSI in 15 minutes. 0.5 is the reccomanded by the guyes here at bluerobotics so i feel safe :slight_smile:

Everything is working except for sensors + auto modus (stabilize, depth hold e.t.c).

A big minus is that i found out that one of my thrusters was defective from BlueRobotics it seemed like there was glue on the rod + glue on the bearings which cracked it when the motor was turned. I removed the glue from the rod, but the cracked “plastic” holder for the rod i need to ask them if i can do anything about. Talking to them on FB so prolly gonna be good soon! :slight_smile:

(Jacob) #3

Great work, very impressive! I really (really) love the i2c power module mod and the minimal construction of the mod. One thought I had was that 4PSI is just out of the BMP180 pressure sensor’s spec. It is probably ok, but accuracy may be a bit off in that range. Maybe you should confirm your results with a gauge.


(Thorleif) #4

Hey, and thanks Jacob! The I2C module power module was supposed to be an attiny85 actually, even smaller :wink: But since they lack true i2c i got glitches with tinywire i2c “hack” and went for the Atmega328-PU. Way overkill for only needing i2c + 2x Analog Digital converter pins :stuck_out_tongue:

I never thought about checking the specs for the BMP180, good input thanks. My hand held vacuum pump thingy actually dosent show me a good reading. The manual says to pump until 9inhg which is 4.42psi and the BMP is rated for 4.35 so i might actually change the code to stop you at 4.4PSI and count time until 4.9 so I’ll stay in spec!

At 4PSI my gauge shows I’m way over 4inhg so i dont know what to “thrust”, the BMP180 or the guage :stuck_out_tongue:

Waiting to test the app now when weather + water gets ready. Still need to learn + understand how to use the sensors to create an artificial horizon + add the “modes”. If anyone here feel they can contribute, feel free to contact me on facebook or something. When its done i want to share the code for others to “hack” it and make it better :slight_smile:

Also hoping to make an raspberrypi shield which contains everything, PWM, sensors, i2c connctors for bluerobotics stuff with just “plug’n’play” then a easy guide to download the software.

This software makes the ROV controllable over internet also if you just add a RPI with 4g dongle to relay port 80 down to the ROV so anyone can run this. (tested, stable and had latency below 200ms) :slight_smile:

(Thorleif) #5

First dive! Tuned PID controller for depth hold, had a 0-3cm variation if the pressure sensor from bluerobotics are thate accurate.

Next is heading hold, artifical horizon to get more info and software optimizing :slight_smile:

(Adam) #6

Looks great! Careful with the tether, it can be a real pain to untangle if you’re in a tight spot. Continual awareness of your surroundings is a must.


(Kaos) #7

Is the gopro direct feed to top station or just overlaid after in post prod. The gopro has a much better colour to it. Nice to see it running:slight_smile:

(Thorleif) #8

Yeah, luckily I worked as a ROV Pilot offshore so tether awareness is already punched into my head. Problem there was I let my buddy run out 100 meters of tether when he went back he went the wrong way under that line, hehe! :slight_smile: But I got it fixed quickly :slight_smile: One think I miss is more camera’s. We had one camera behind watching the tether all the time with great light. And we had black+white camera for low light and full hd camera for normal operation.

I think the overlaid picture is kinda “crappy” so to say. Are your low light modules better? Worth it you think?

I currently have this: https://www.sainsmart.com/raspberry-noir-pi-camera-module-board-5mp-webcam-video-1080p-720p.html

Not sure if its noir or not but. Any idea?:slight_smile:

(Thorleif) #9

The overlaid picture is just an edit, the gopro picture is not feed up. I am thinking about it since the GoPro has WiFi streaming and raspberry has wifi buildt in. There might be a possibility to catch the stream and send it up the tether as a “better color camera”. But I might just be ending up replacing the PI Camera. Think its pretty “crappy” :slight_smile:

(undersearobotics.com) #10

Watched the video. That “NODEROV” software is pretty cool!