Tuning a boat from 3.0 to 3.3

Little video I made of tuning a boat to the new firmware version. It’s pretty boring but if it helps one person it’s worth it. Not done tuning yet but very close. I’m still trying to digest the log and figure out what to do.

2 Likes

Hi David,

nice video and great boat! Love seeing these.

So the key thing to tune is the ATC_STR_RAT_FF parameter. We use layered PID controllers and for the steering control, the lowest level is the turn-rate controller. If we get that one tuned well, pretty much everything else works properly.

I find the easiest way to get this parameter right is to:

  • connect the Mission Planner to the vehicle’s flight controller using a telemetry radio
  • set the GCS_PID_MASK to 1 (Steering)
  • on the Flight Data screen, check the “Tuning” checkbox (bottom middle) and select “pidachieved”, “piddesired”
  • put the vehicle in ACRO mode (or maybe AUTO will work too) and drive it around a bit making corners
  • increase or decrease the ATC_STR_RAT_FF parameter until the “achieved” mostly follows the “desired”. If achieved is too low, increase ATC_STR_RAT_FF. If achieved is overshooting the desired, then lower ATC_STR_RAT_FF.

By the way, I’m hoping/planning to make a rover/boat tuning video but haven’t quite done it yet.

Also if you upload a log I can take a look, and estimate a good FF value.

Ah, the “feedforward” value immediately adjusts the steering based on the desired turn rate. So say you request a 45 deg/sec turn, that will immediately move the steering angle to a particular position. The P,I and D values all work off the error… so the feedforward leads to a faster response. Also it kind of lays the ground work for the P,I and D terms but getting the steering output close to what it should be.

Ah, one last thing, can you show me what the steering control looks like? Is it a rudder or two thrusters?

Thanks for the advice. I will get out maybe tomorrow and have another try at it. Here is the log from my tuning day. https://1drv.ms/u/s!AgqdUNhfFlnDgbNaP5D1cjfKD7CX-g

The boat uses thrusters and rudders. I feel more comfortable using rudders to steer just in case a thruster gets fouled with something. I’ll dig up a picture of it.

Here is a bad picture. https://1drv.ms/u/s!AgqdUNhfFlnDgbNbpxYqwXT4Y2rWXg
Two thrusters and two rudders.

OK, thanks. It’s a big log! … a bit hard to work with but it’s still helpful so txs.

The throttle/speed control looks pretty good (I checked THR.DesSpeed vs THR.Speed and they track well). It’s possible to smooth out the acceleration and deceleration a bit by setting ATC_ACCEL_MAX to 1 (currently it’s the default of 5 which is too high for most vehicles so we plan to reduce this default in 3.3.1 or 3.3.2).

In the middle of the log the steering gains look OK. At the end they are definitely too high.
Maybe try:
ATC_STR_RAT_FF = 1 <-- this parameter is the most important
ATC_STR_RAT_P = 0.3 <-- P should always be lower than FF
ATC_STR_RAT_I = 0.3 <-- I doesn’t matter too much, perhaps keep same value as P
ATC_STR_RAT_FILT = 10 <-- won’t have much effect

The mission performance in the middle of the log also looks pretty OK. What was your feeling about the mission performance?

Mission performance was good after the first few runs. I agree that in the middle of the log things look much better than at the end. Towards the end of the log is when I started changing my NAVL1 parameters that worked so well with 3.0. I think I’m asking the boat to steer in a manner that it is not capable of. I will be putting the NAVL1 parameters back to where they were in the good part of the log. Thanks again for your time. I’ll probably watch my video again and look at my notes of the order I changed things. I’ll try your recommended ATC’s but I think the NAVL1’s mucked things up at the end. My turn radius is probably 2 or 3 meters on this boat so it can only correct so fast. Thanks again.

David

Reducing the SPEED_TURN_GAIN parameter from 50 to 30 may also help with the wide corners.

By the way, I think we are going to improve the navigation controls over the next few months. Until then we will likely do some band-aid fixes and changes to the default parameters to make it perform by default more like people want it to perform.

1 Like

My SPEED _TURN_GAIN is currently 100. My TURN_RADIUS is .9 and probably should be 2 or so. I’m going to reset my parameters to what they were in the 5th or 6th Auto run I did in that log I sent you. I’m planning on doing a survey grid this weekend with the depth sounder on it. Soo… The FF would be 1, P and I .5, and the filter at 10hz. I will also try your .3 P and I suggestion.

OK great.

Re the depth sounder, you might have seen that we’ve added support for the Echologger.com’s ECT400 and probably any other depth sounder that can provide NMEA data.

Are you using ReefMaster to process and view the final data or something else?

At the moment I’m just using Insight Genesis for a contour map and bottom hardness. The boat carry’s a Lowrance Elite 4 sounder.

1 Like

For what its worth you may have seen this before.

2 Likes

Randy,

Just thought I would let you know I did a flawless survey grid with the boat. FF at 1, STR P and I at .5. Have not looked at the logs but rudder output over 200 meter straight runs was minimal and the boat tracked perfect.

1 Like

David,

Excellent! Really great to hear! Thanks very much for testing and reporting back.