NodeROV - NodeJS / HTML based control software

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.

Modifications:
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:

http://link.jepb.no/jWVV

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:

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:

3 Likes

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.

-Jacob

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:

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:

1 Like

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.

-Adam

1 Like

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:

1 Like

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: SainSmart 5MP Camera Module Fisheye Lens FOV160 Supports Night Vision for Raspberry Pi 3 / Pi 2 – SainSmart.com

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

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:

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

Long time since I’ve worked on this. Had a break due to programming on a board that is in the ROV is kinda cumbersome.

So I’ve a long time had thoughts on how to make it better and easier to develop. So I basically buildt my own PCB “Hat” for the Raspberry PI with all the components above embedded.

Still waiting for some headers to test this bad boy out. This has a 9axis imu, pressure sensor, buildt inn bluerobotics leak sensor, pwm controller and two power supplies (one for 3A 5V for Raspberry Pi and one 2A 5V for servos and stuff), also buildt inn voltage and current sensor.

Hoping this will spark my interest in further develop this software. My main obstacle now is how to get video feed from the pi to my app in a best possible way. Currently my app client is run in the browser which limits the capabilities for video streaming. Wish I’d mange to make it like QGroundControl where they use a dedicated software. But that breaks with my “should work on most OS’s”. And i do not know any native software programming languages unfortunately.

(And yeah, I see that I’ve mounted the angled headers wrong way around. It was 1:47AM when I was going to bed I saw that I had 2x 4row headers laying in a box. And I just had to put them on “asap”. Regretting that decision now!)

2 Likes

Congrats @Thorleif - that’s really impressive! I like the miniaturisation of the PCB HAT - it should save a lot of space in an enclosure for more interesting sensors :grinning: and also be very reliable. I also agree with the philosophy that is “should work on most OS’s”…

Our approaches are exactly the same both in terms of hardware and software. I too have customised the hardware, removed the pixhawk, and customised NodeRed - in my case physical joystick-less control.

I personally would also look to put a GPS on the PCB board to help with logging, mapping, and potentially assisting with autonomous operation, but looks great!

Hi thanks :slight_smile:

You would not get far with a GPS under water so that would be surfaced operation only as the signals wont go far below the surface. But as there is 4 i2c headers there is a possibility to add a 5v i2c GPS to this setup. There is also a pad for an extra Analog signal to be monitored for other sensors.

The alternative to a GPS would be echolocation which again has the same costs as the ROV. But for the software to note the dive location automatically that would be fun. Could add so it turns on the gps at 1 meter depth and off when deeper. Would be a nice feature to autolog dive locations.

As this is my first PCB design and bigger electronic project I’ve not thought about adding too much. KISS as they say (Keep It Simple Stupid) :slight_smile:

For now I’m really happy with the board as it compresses what I’ve created in the original post March 2017 into 1 board :smiley:

Just the software part remaining :smiley: hehe

I would think there would be a commercial application for a ROVHat similar to yours that all you had to do was slide it down on the Raspberry PI. Simple and elegant :grinning::grinning:

I am aware that GPS does not work underwater. I have GPS on my ROV and believe there is still utility value, but like you say it could be added to your board later.

What are your goals for the software?

My goals are mostly to have a product which can be a drop in replacement for the ROV Software and internal hardware on BlueRobotics ROV. But not as a commercial product. Just for people I come across when talking about my ROV and they have the same thing.

This product will be a fully “IMU” so you could possible use my hat to control a quadrocopter, another ROV e.t.c. But currently I’m hard coding the software for BlueRobotics sensors as that is what I have.

1 Like

Sounds good - Feel free to email me or we could set up a skype call to compare notes if you were interested as we may have encountered the same issues with the similar software setup…

An update on the project. There are no reason to think you’ll get it right the first time. A failure is just a learned lesson. My project was pretty good, my ADC was too tiny for me to hot air solder and even though I think I had it properly but did not see it on the I2C bus, and without an oscilloscope I’m not sure if I was my bad or not. So I’ve swapped it with a SOT package which can be hand soldered without an hot air station.

Then there is the BNO055, a superb sensor with a built in microprocessor. BUT it uses I2C Clock Stretching, which the Raspberry PI natively does not work with. So the trade off is that I have to use raw sensors and calculate the angle and acceleration in my app. Which is not such a big problem when the Pi is as powerfull as it is right now.

Here are a new photo of the modified board:

Already modified the Eagle files to implement the swapped chips onto the board. Removed 1 I2C connector as I think 3 will be enough and they are only 3v3 not 5V. Possible removing one leak sensor connector aswell. But my board includes a “I2C Extender” board with 4 more ports on the cutout part of the board. So it can be removed and attach 4 plugs and it should work on the same bus.

Not quite certain about removing 5V support on i2c. Maybe add another i2c connector with 5v on the 5v side aswell so you can choose to extend the 5v or 3v3. Still figuring things out :slight_smile:

As for now all BL sensors are 3v3 so :slight_smile:

My main problem is still video transfer! :frowning:

1 Like

Hi, I dont use skype that often but my name there is: “thorleifjacobsen” :slight_smile: