Home        Store        Docs        Blog

Information on Fathom-S and How to with arduino to Basic ESC

fathom-s

(Matt McElrath) #1

Hey, so our club recently acquired four T100 thrusters and a Fathom-S tether interface with 50 feet of tether to use on our ROV for the MATE ROV competition, and are trying to figure out how the Fathom-S interface works. I’ve viewed your technical documentation and was wondering if anyone knew the awnsers to 1. How you get power to run down the tether from the top board to the bottom board using one tether, or if its that both boards need outside power (we cant tell which it is from the technical documentation) 2. How you would wire analog joysticks to pass through the interface and the tether down to the arduino

We are also having issue getting our arduino code to work well with the Basic ESC. Its a edited verison of the Blue Robotics sample code for a parallax joystick(would link but new user limit) that i’m trying to get to work with a adafruit joystick but when i go into the serial monitor each joy stick seems to control all of the motor outputs, and while we haven’t been able to get all of the motors wired yet, when hooking up just one it is very spotty on whether it will turn at all. Can anyone give me some advice on how to better code this? Im still new to coding and i’m stuck on where i’ve made an error in the code. Ive uploaded the edited code here. The codes goal is to use two joysticks to drive 4 motors (the original code was for 3 motors). We have two horizontal motors, one left one right, and two vertical motors we want to run in sync. There is also side code in their to run a servo to control the Blue Robotics Analog camera, but that hasnt been tested as of yet.


#2

I’d think of the tether interface like a two-wire 10/100 ethernet switch, meant to pass data from another device between two switches. The other six wires could be used for power, but more like POE levels of power. We used to pull stupid amounts of current through 24 gauge wire in the R/C airplane days, but we used Tefzel jacketed wire and kept the bursts very short. I’d be tempted to risk 50 meters of tether using the remaining 26 gauge six wires tripled up for power, but that jacket melts when my soldering iron gets within ten feet of it, so I think you’re going to have to power everything separately.

I’m guessing would connect your game controller to the topside arduino, either directly or through a laptop. If directly, you’d have to splice in and supply your own power to the game controller and Fathom-S, or maybe you can use the USB port to power both if going through a laptop. Anyway, your topside arduino would need an ethernet shield, then connect the two wires to your Fathom-S, then you basically have the reverse setup on the wet end, except your arduino would output commands to the speed controllers instead of accepting input from the game controller. I don’t know anything about programming arduinos, but googling various phrases about connecting a game controller and controlling speed controllers looks to be common things with sample code available.


(Matt McElrath) #3

Original code from BR is here: https://github.com/bluerobotics/br-esc-examples/tree/master/arduino/AnalogJoystickControl


#4

Sorry, I was thinking of the Fathom-X, but the concept is similar in that you’re just using the Fathom boards to pass data from one arduino to another arduino. I think they’re basically just USB/232 to 422/485 converters to get the distance. Either way, the Fathom boards should essentially be invisible to your arduinos, so I’d start this project without even using the Fathom boards at first. Maybe start by getting two arduinos talking to each other, then get joystick input to arduino1 to show on arduino2, then get arduino2 to control thrusters, then add the Fathom boards between arduino1 and arduino2.


(Matt McElrath) #5

What if we are using just one arduino on the rov its self? its for a school competition and there are some limits on what we can do


#6

Short answer is that I have no idea, but I don’t think the Fathom boards work that way. I don’t really know how data is transmitted, but it needs to be encoded (232/422/485/ethernet/etc) to be passed from one point to another and it needs that encoding done before it gets to the Fathom board, which is why it has a single USB port or single TTL input instead of a ton of GPIO type inputs. If the board did the encoding, you’d probably be connecting each function of a joystick to a specific input on the board. If you didn’t want to use a computer/arduino to convert the analog joystick to serial, but were willing to change joysticks, you could probably just use any USB game controller since the analog input from the sticks are being converted to serial inside of the controller. You just need some method of converting analog to serial before it gets to the Fathom board, because that’s not what the Fathom board does…again, I think, because I don’t really know what I’m talking about.


(Rusty) #7

Hi Matt,

Thanks for the post! I’ve got some answers here:

  1. Get power from the surface to the ROV is separate from the Fathom-S board. The Fathom-S doesn’t carry any power, it just has serial communication and video. You’ll need separate wires to send power.

  2. The serial communication can be used to send messages from the surface to the ROV. The Arduino on the ROV would listen to those messages and translate them into outputs to the motors. You can’t connect the joysticks directly to the Fathom-S.

Let’s start by making sure your test code works and then we can figure out how to send it through the tether. If you’re having a spotty time getting the thrusters to spin at all, then it’s likely that the joysticks aren’t centered very well and the speed controllers are never getting the “stopped” signal they need to be calibrated.

I would start by checking to see if the outputs are centered at 1500 when the sticks are not moved. If not, then you can add some print statements to read the raw joystick values and adjust the JS_CENTER_x values to match the actual center points.

Also, if you want the vertical thrusters to be in sync, you don’t have to read in a new value, you can just write the same value to both thrusters like this:

thrusterVertical.writeMicroseconds(CENTER_THROTTLE+verticalCommand);
thrusterVertical2.writeMicroseconds(CENTER_THROTTLE+verticalCommand);

Let me me know how that goes!

-Rusty


(Matt McElrath) #8

Ok thanks for that advice, ill give that a go and come back if I cant get it to work, real quick though, in serial print are all the outputs supposed to be the same? When i load up the serial monitor, all values are the same no matter which joy stick i use, when I push the joy stick, all values move the same…


(Jacob) #9

@MMcelrath It sounds like you might have some bug. Check your code to make sure it is doing what you expect. If you need help debugging, please share a copy-paste output (try pastebin.com) of the entire program that you are putting on the arduino, and the output in the serial monitor.


(Matt McElrath) #10

Ok, The code is on Github as linked above (it wont let me relink it but its the [Here] link above) , ill get a pastebin of the full code probably tomorrow, I dont have round the clock access to the building our tech is in.


(Jacob) #11

I just wanted to verify if you have made any modifications to the code.


(Matt McElrath) #12

Newest code version as of today and Serial monitor output. For the first time today, I finally got the motors to make more than the DU DU DUT noise, it started swapping between an EMMMMM ERRRNNN noises every 1.5 seconds or so once I hooked up the Arduino this time, and started running at a low speed (I assume this has to do with it not all being 0 in the serial monitor when the joystick is idle) It then would proceed to unproportional ram up and then completely stop as I progressed the joystick, then sound as if it was rebooting via the tones. What did I do???


(Jacob) #13

Line 39 in your output: 1. Fwd: 1600Turn: 1450Vert: 1278

Take these numbers and plug them into the writeMicroseconds in your program:

thrusterLeft.writeMicroseconds(CENTER_THROTTLE+forwardCommand+turnCommand);

becomes:

thrusterLeft.writeMicroseconds(1500 + 1600 + 1450);

The valid input signal from the esc is a pulse width between 1000 and 2000 microseconds. You are giving the esc invalid signals, and they are beeping errors at you. Try to adjust the joystick range and center definitions at the beginning of the program to match the joystick values that you get with a simple analogRead() program.


(Matt McElrath) #14

Any recommendation of what would be a good range or center based on your knowledge? Ive been experimenting with it but to no success atm though i might be close.


(Matt McElrath) #15

Thank you so much! I finally got the motors working!