Go Down

Topic: ROV truster question (Read 2068 times) previous topic - next topic

tanner331

Hi
I am working on a submersible ROV and I am trying to figure out how to run the thruster configuration.
I will be using a arduino running brushed DC motors in a configuration shown below.
The image of the 5 truster system shows the motor configuration.

I will be controlling the system with either a 3 axis joystick or a 2 axis joystick and a potentiometer.
I am trying to figure out how to program the motor controls being that all 4 horizontal axis motors are used in each direction of movement.
The joystick configuration will be the following, forward and backward will move the ROV forward and backward, side to side on the joystick will move the ROV sideways, and twisting the joystick will control the ROV in the yaw, rudder, directions.
I am mainly looking for some advice on how to start the program process and some advice and maybe some examples of code I can go off of.
Thanks
Tanner

AWOL

Quote
I will be using a arduino running brushed DC motors in a configuration shown below.
The image of the 5 truster system shows the motor configuration.
Did you forget something?
"Pete, it's a fool (who) looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

tanner331


keeper63

Well - numbering the thruster motors, starting from the front left and going clockwise (ending with the center motor):

1 - front left
2 - front right
3 - rear right
4 - rear left
5 - center

Up and down are simple (just control speed and fwd/rev of thruster motor #5)

To go forward, motors 1, 2, 3 and 4 need to be turning so that the thrust is to the aft of the vehicle; to go in reverse - the reverse is true.

To rotate counter-clockwise, motors 2 and 3 need to be turning so that the thrust is to the aft of the vehicle, while motors 1 and 4 need to be turning in the opposite direction; to rotate the other way, reverse this.

To go sideways to port side, motors 1 and 4 need to be running so that 1 is sending thrust foward (as if it was operating in reverse mode) and motor 4 running as if it were running to send thrust to the aft (as if it were operating in forward mode); the other two motors 2 and 3 need to be opposite of this.

To implement this - create a function to activate each motor, where you pass in a value for the motor (0 - 4), a value (1, 0, -1) to indicate direction (set the direction value as a set of three constants - don't use the actual numbers in your calls) - and that function will set the pins (and maybe speed) for the appropriate thruster - ie:

Code: [Select]
void setThruster(int thruster, int direction, int speed)

You would call it like:

Code: [Select]
setThruster(PORT_BOW, FORWARD, 255);

...where "PORT_BOW" and "FORWARD" are constants that you define to define the set of thrusters (ie - PORT_BOW, PORT_AFT, STAR_BOW, STAR_AFT, MIDDLE) and the directions (FORWARD, REVERSE, STOP); doing it this way instead of numbers will make the code easier to read and understand as you develop it (and later maintain it).

Once you have that function written and working, then it is just a case of defining other functions to implement the set of various conditions outlined above, based on the joystick input - for instance, moving up/down might be done as:

Code: [Select]

int joyval = {read the joystick here};

if (joyval > 192) {
  setThruster(MIDDLE, FORWARD, speed);
}

if (joyval < 64) {
  setThruster(MIDDLE, REVERSE, speed);
}


Note that all of the above should also be implemented as a function - break everything down into simple, reusable functions - and it will all fit together properly in the end (plus it will be easier to test each piece in isolation from the rest).

Hope that helps some...
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

zoomkat

Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

oric_dan

I don't know anything about this topic, but Jon Hylands has some info online,
http://www.huv.com/uSeeker/index.html

Also, some reference material,
http://www.transit-port.net/Lists/AUVs.Org.html

Go Up