ArduSub v3.6.0 SITL | STABILIZE and ALT_HOLD modes do not work as expected

Hi!

I’m trying to test the newest functionality in ArduSub v3.6.0 beta, especially what is related to setting the desired attitude and depth in alt_hold mode with no GPS. I use Sub-3.6 branch with no modifications.

I have limited access to the robot now, so SITL is looking like the best friend of mine. But, It looks, that SITL simulation for stabilize and alt_hold modes is not working properly from the box. I was able to use manual controls to run Bluerov2 in sitl simulation, however.

Here is how I run the simulation:

python3 ~/ardupilot/Tools/autotest/sim_vehicle.py
–vehicle=ArduSub
–frame=vectored
–aircraft=“fishbot”
-L RATBeach --out=udp:0.0.0.0:14550
–mavproxy-args “–out udpbcast:localhost:14551 --mav20 --moddebug=3 --streamrate=50”
–console
–map

Then, I’m trying the following in MAVproxy shell:

MANUAL >> rc all 1500
MANUAL >> arm throtle
Doing whatever I want with “rc ch pwm_value”.

MANUAL >> disarm
MANUAL >> rc all 1500
MANUAL >> mode STABILIZE

At that point, even if I do nothing and all rc are set to 1500 - ROV starts drifting and waving.
The same in alt_hold mode. And the same if I switch to stabilize or alt_hold from the beginning of a simulation.

I attach here logs and parameters I use. Parameters are not modified.

Many thanks for any help!

flight.tlog (7.9 MB)

mav.parm (26.8 KB)

00000001.BIN (1.2 MB)

Hello,

I managed to reproduce this behavior here. Our SITL model is a very simple physical model of the ROV. You can see in the logs that the roll value is amplified over time, that is most likely due to the drag in SITL being too low (the frame oscilates and when tilted the vertical thrusters have an horizontal component). I suggest you try increasing it here.

Among other things, right now SITL is also missing support to the heavy frame and the modeling of the static stability.

Hi, Willian!

Thanks for the answer. I’ll try to increase damping as you have suggested. BTW, have you done any validation study for the model or at least comparison against experimental data? I’d like to know the scenarios in which it actually can be used. This info can save time for me and other users of Bluerov2.

BR, Alex.

Willian, I’ve started doing changes, but can’t get the idea behind dividing the (angular drag?) force by robot’s weight.

rot_accel -= angular_drag_forces / frame_property.weight;

As far as I remember it has to be in rad/s2 units, but this formula suggests that it is N/kg, looks more like linear acceleration to me.
Shall it be somehow connected to the robot’s rotational inertia tensor and connected (water) mass?

most likely due to the drag in SITL being too low

With 100 times bigger drag it is still drifting.

Hello,

You are right, this looks wrong. It was quick and dirty way to add some angular dampening. The SITL overall needs some work and improvements. to do some work on it it during the next few months.
If you have the knowledge and could send a Pull Request to improve this, that would be very welcome!

My mistake. In Depth Hold or Stabilize modes, some drift will likely happen. To keep position in SITL you should try using Position Hold.

Hi!

If you have the knowledge and could send a Pull Request to improve this, that would be very welcome!

I’d like to, but we do not have localisation system yet, so my update can only address rotational dynamics. If you have datasets recorded for the translation and rotation - please, share. It can helps me a lot to improve current sitl model.