Rotation issue when dive/emerge in Custom Frame ROV (using openrov hard/software)



hello to all,

There is a way to add some thrust to the sides motors when using the vertical motor for diving/emerge to avoid ROV rotation (I use Custom Frame)

Im thinking changing the some values in code?
When i use pc keyboard to control ROV, can’t use at the same time vertical and horizontal motors, for correct rotation.
Is it possible to use them both then been controlled by Gamepad ?


Yes, you can control both the vertical and the horizontal motors at the same time with a Gamepad controller.

@badevguru or @spiderkeys are you able to help with where these values would be in the code?


Thanks Brian,
Good that helps with gamepad.
Also changes to the code will be perfect.
But I’m afraid that will need a patch :confused:


This is something we will work on. Getting the counter rotation thrust right is non-trivial and I suspect we will use a feedback loop from the IMU to make it happen.

In the meantime, if you do have an IMU you can dive with heading hold on and it will automatically try and counter the rotation. The heading loop is currently very basic so your milage may vary.

If you want to experiment with hard cording a counter rotation while diving, I would suggest doing it in the Arduino firmware. Technically you can put this logic in the javascript side as well, but closer to the motors is better.

If modifying the code on the 30.0.2 image you would change the lines below to also set nudge the p/s target values of the motors in microseconds to induce the yaw:


Badevguru hi!
unfortunately i dont have IMU. (i will, when capital control ends in my country)
so now i have to make it work “manually”.
i prefer to make changes to arduino firmware while diving :wink: for sure!!
i need some basic steps though,
to edit and then upload firmware:
where i can find the code so i can change it?
how connect, then to upload the code ?
i had upload the firmware from putty. but i didnt download any file so im not familiar with the other way.

i went to github where there the thruster2x1.cpp is but the description at openrov directory was “test”.
is that the code?
have a nice day :slight_smile:


I recommend using the 30.0.3 beta because the cloud9 IDE is fixed. This allows you to use the browser to edit code directly on the ROV. You will see an Arduino folder. Under that select the OpenROV folder. That is where all of the files for the Arduino live.

After making changes, use the cockpit upload firmware function to apply the changes to the Arduino


Brilliant!!! :floppy_disk:


Badevguru hi again,
i download and flash 30.0.3 beta,
i succesfully open and find the code through cloud9 :slight_smile:
i change some values but maybe i do something wrong,
i follow the debuging instructions as you posted on 30.0.3 download page.
please tell me wich values should i change so the right motor run a 1-2% whnen vertical motor runs in the Trusters2x1.cpp


Hey, I’m busy on core features at the moment so my feedback may be slow. If you can get one of the coders in the forum’s excited about the feature, that may speed things along.

In the meantime, the firmware has a p,v, and s value which are the target values in micro seconds for the motors. By changing those, you change what the motors will be set to. My guess is that you would probably want to place the code here:

Right before the actual values are assigned to the motors. You can then figure out some logic that notes that there is a vertical motor command (v), and then you can induce a counter yaw my adding a value to § and reducing the same value from (s). You will also want to make sure to remove that counter yaw when the vertical value zeros out. To do so you will probably need to add some variables to track that you have introduced the counter yaw so that you know to later remove it.


Oooh, I see!
Many thanks badevguru! ill do my best :wink: