John Easton's boat navigation

This is a topic for John Easton’s wobbly navigation which was initially raised on facebook.

Both steering and throttle are having real troubles. Below is a graph of the throttle output (channel 3) vs the vehicle’s speed. It shows a very big oscillation in the output speed almost perfectly out of phase with the output to the motor.

I think this will help with the speed control:

  • reduce ATC_SPEED_FILT to “1” (it’s possible even lower value will be required) This will smooth output the input to the speed controller so that it responds much more slowly. I’ll reduce the defaults in master as well so future users get a better starting point.
  • reduce ATC_SPEED_P to 0.02
  • reduce ATC_SPEED_I to 0.02

It’s actually possible that the unstable throttle output is affecting the steering control because (I think) on a boat the turn response is proportional to the motor output so fixing the above may help steering too. Anyway, in the steering control we still see that it’s not able to achieve the desired lateral acceleration.

This may help:

  • set TURN_MAX_G to 0.2 (currently it’s an unrealistic 1G). This should stop the controllers from attempting the impossibly high lateral acceleration requests.
  • set NAVL1_PERIOD to 12. This will slow the aggressiveness to get back on the path
  • set NAVL1_XTRACK_I to 0. This will stop I term build-up in case the navigation controller’s requests cannot be executed by the lower level turn controller.
  • reduce ATC_STR_RAT_FILT to 5. this will slow down the steering response.
  • reduce ATC_STR_RAT_P to 0.2.

By the way, what type of GPS are you using? If it’s a Ublox could you try setting GPS_TYPE to “2”.

As a side note, it would be great if the logs could be made smaller. It looks like the vehicle was powered on for about 2hrs 15min. Shorter tests as we get it tuned will help me by making the logs smaller and speed up the viewing of logs.

Hopefully this helps.

1 Like

This will be great help Randy.
I am using Pixhawk2.1 with Here compass

1 Like

No problem.

Leonard and I have talked about making a Rover/Boat autotune mode a bit like copter’s… it’s tricky though so it’ll be a few months at least.

No worries, anything I can do to help/test just let me know.

And yes, I will be doing some shorter test missions until I get this sorted out.

This is the original Facebook Post on Ardupilot.org - https://www.facebook.com/groups/ArduPilot.org/permalink/1732777716745414/

1 Like

Ok so I will be testing tomorrow with the following settings, should I make any further changes?

The turn rate controller hasn’t been tuned so it’s not performing well (sorry, we don’t attempt to automatically update tuning params from 3.1 to 3.2 because they’re too different). I think the ATC_STR_RAT_FF should be increased from 0.2 (the default) to about 0.6. The TURN_MAX_G should probably also be reduced from "1"G to something more reasonable like 0.3G to stop it from attempting the impossible
The throttle/speed controller needs some tuning as well I’m afraid. There’s good advice on the wiki for setting the CRUISE_THROTTLE and CRUISE_SPEED values using the auxiliary switch but to get started, I think CRUISE_THROTTLE should be increased from 10 to about 80.
http://ardupilot.org/.../rover-tuning-throttle-and-speed
Note: in Rover-3.2 the waypoint navigation speed can be set using the WP_SPEED parameter instead of changing CRUISE_SPEED.
set TURN_MAX_G to 0.2 (currently it’s an unrealistic 1G). This should stop the controllers from attempting the impossibly high lateral acceleration requests.
set NAVL1_PERIOD to 12. This will slow the aggressiveness to get back on the path
set NAVL1_XTRACK_I to 0. This will stop I term build-up in case the navigation controller’s requests cannot be executed by the lower level turn controller.
reduce ATC_STR_RAT_FILT to 5. this will slow down the steering response.
reduce ATC_STR_RAT_P to 0.2.

1 Like

Hi John,

That list of changes looks good. A couple more changes mentioned above that might have been missed:

  • reduce ATC_SPEED_FILT to “1”
  • reduce ATC_SPEED_P to 0.02
  • reduce ATC_SPEED_I to 0.02

Looking forward to the results. Hope it works!

I have found 0.2G a too big value. 0.02 works ok for me. There is some explanation on how to write such a small value on MP.

1 Like

Oh yes, I forgot to add that to my list above but those changes have been made.
I noticed TURN_MAX_G and ATC_STR_RAT_P goes red when I insert these values, any idea why it does that?

I will give some feedback later, heading off to Inanda Dam in the next half hour.

Thank you for your help.

1 Like

The value going to red must indicate that the ground station (QGC or MP?) thinks they are out of range. If you can update the values then I wouldn’t worry for now. The values are within the acceptable range according to the latest parameter descriptions in ArduPilot so perhaps the ground station is using old parameter descriptions.

Ok, this is the first pass with the actual track overlaid on top of the Mission Planner Flight Plan …

Here is the log … https://www.dropbox.com/s/cvu2z608tr78rga/00000091.BIN?dl=0

This is the second pass of the same mission but I tried to reduce the speed, but it seemed to be doing the same speed even though I reduced to 2m/s …

Here is the log - https://www.dropbox.com/s/fdww0ano9958401/00000092.BIN?dl=0

I took two videos - this one is at waypoint 6 …

This video is at waypoint 8 …

1 Like

Please, show pictures of your setup!!!
what a wonderful boat!

Congrats!

2 Likes

I seem to remember in the past that there was a setting to reduce the throttle to 10% when arriving and departing from a waypoint, but cannot find it now.

Thank you, there is a post somewhere here that shows the beginning of the build, I will try find it.

Nice video and thanks for the logs. Certainly it’s performing better and I think the latest beta will help some more because it fixes a bug that affects the “origin” of a track.

Here are some other things I found in the logs:

  • increase CRUISE_THROTTLE from “10” to “80”. If CRUISE_THROTTLE is 10% while the CRUISE_SPEED has been left up at 3.5 (m/s), this means that to the throttle controller thinks the vehicle can reach 3.5m/s at only 10% throttle. It’s closer to 100% throttle required to reach 3.5m/s. This leads to the I-term having to do all the work to control the speed and this leads the throttle control to be quite slow I think.
  • ATC_SPEED_I can probably be safely increased from 0.02 to 0.05.

The result is the throttle is much smoother than before but I think increasing CRUISE_THROTTLE to 80 would be good for the next test.

For the steering control, it’s doing much better than before but this could help:

  • reduce TURN_MAX_G from “1” to “0.2”. We can see from the Desired lateral acceleration (in red) that the navigation controllers are requesting up to 3.8m/s/s (0.4G) but the vehicle can only do about 1.8m/s/s (0.18G).
  • increase NAVL1_PERIOD from “12” to “15”. This should help stop the weaving I think.
  • increase ATC_STR_RAT_FF to 0.8. Reduce ATC_STR_RAT_P to 0.5.

below is a graph Desired Lateral Acceleration (red) vs Actual Lateral Acceleration (green)

below is a graph of the contribution by P, I, D and FeedForward to the output

Thank you so much for all this information Randy, I can’t wait to get back on the water with these new settings.

I will post today’s results shortly, it was an absolute stinker on the water today, I thought I was going to melt. LOL

No problem. By the way, the parameter to slow the vehicle during turns is SPEED_TURN_GAIN although 3.2 should do a better job than 3.1 did. 3.1 would only slow-down after it reached a waypoint but 3.2 should slow down before reaching the waypoint as well.

Actually the ATC_ACCEL_MAX value should probably be reduced from 5 (m/s) to 1. This is a more realistic value for this frame and should lead to smoother accelerations.

Today I tried the same settings but with a different motor as I thought it might be my hardware in some way.

It turned out to be exactly the same, but the good news is that due to me making so many passes of the same mission, I could see that it was repeating the same error time and time again.

The Error:-
When the craft arrives at a waypoint, it is very accurate (mostly), but as it over runs the waypoint it seems to ‘panic’ and starts taking radical action to try correct this taking 120m before it is back on track.
The tighter the turn to the next waypoint makes this worse.

1 Like

Updated to the latest Rover Beta firmware and all the settings updates as instructed above.

Did 4 passes of the same mission:
Pass1 -

Pass 2 -

Pass 3 -

Pass 4 -

Log File for Pass 4 - https://www.dropbox.com/s/q034qyi3kli8bs6/00000102.BIN?dl=0

Video 1

Video 2 - Look at the crazy angle it took here! This is very aggressive and potentially a big failure in rough conditions!

Comparison between yesterday’s settings and today: An improvement for sure, but the excessive throttle after the waypoint is still a big problem.

1 Like