Tuning tips for my new Autonomous Jet boat

Hey everyone. I have a new jet boat project i’m working on. So far i’ve only been doing some base testing in a local pond. My eventual goal is to run a section of a local canal, and if that goes well i’ll make an attempt at a run up the local river.

At the moment I am struggling with getting consistent telemetry. I am using these same Xrock 1000mw 900mhz radios on my sonar boat project with great results. But with the jet boat i’m not sure if its the lower height of the radio antenna to the water, or the spray off the boat. But as soon as the boat starts running I lose the link. Thats making tuning difficult. I tried today with a significant mast to get the antenna on the boat higher, but that produced some unwanted wobble to the boat and broke after an incident i’ll touch on later. I think next i’ll try a very tall pole on the ground station antenna and a short mast on the boat.

Since I haven’t been able to review how accurately the boat is tracking the waypoints I haven’t mess with much tuning. All i’ve really done so far is setup cruise speed. Tuned steering FF. And adjusted WP speed and min. I’ve also done some adjusting to the throttle accel.

It is running waypoints as you can see hear, I do love hearing it slow for the turn and then accelerate again. I ended up getting FF too high at one point and on 180degree turns the boat would skip off the water. As the boat continued to try and accelerate and steer it would jump out of the water overshoot turn the other way and it was just chaos. Turning FF down seems to have helped that issue, though my turns might not be as tight as they could be. Here is a video running some waypoints. https://youtu.be/VmvEsBFZ0h0

Along the lines of the skipping issue, as I mentioned earlier I did break the mast on todays testing. After probably 10runs when I started a new auto mission the first waypoint was directly behind the boat. As the boat turned it fully accelerated and jumped out of the water, this lead to it overshooting again, then caught water and jumped again and it was just chaos. Switching back to manual is the only way to stop it it seems, but by that time the mast had broke. It seems that throttle is being used to turn? I can hear the motor rev as it turns then slow, then rev again as it accelerates to wp_speed. Is there a way to set it to use less throttle on the turns so I can try and avoid these jumps? Here is a video showing the freakout that broke the mast. https://www.youtube.com/watch?v=Wg_3_ypTIq0

I’m including a log file here, and I do apologize for the size (60mb). This was the entire test session so the log is quite big. Next time I’ll remember to arm and disarm for a single waypoint run to have a smaller log to work with. https://drive.google.com/file/d/16_czHgOsqNyPUtkTKzfS4m70oWOLoeNs/view?usp=sharing

3 Likes

This boat looks really great. I can’t help much with the telemetry issue but I wonder if it might be a power issue rather than an antenna issue. There’s no way to know from the logs but it might be possible to find a correlation between sudden changes in throttle level and loss of telemetry.

Re tuning, how is the steering controlled? My guess is it is one of these three method:

  1. Rudder is placed beside the motor
  2. rudder is placed directly behind the motor
  3. motor/jet is aimed with a servo

If it is (3) then it would be good to enabled vectored thrust. It might even be useful for if (2) is used.

The speed tuning looks very good. Below shows the desired vs actual and they’re right on top of each other.

For steering I think the ATC_STR_RAT_FF is a little too high. If we look at the PIDS we can see the contributions of FF, P, I and we see P and I are moving int he opposite direction from FF. This is not terrible but it means that FF is too big and that P and I are fighting against the FF (because the vehicle is oversteering).

There’s a bit of oscillation in the steering actual but maybe fixing the above will reduce this. If not we can try reducing some filter values maybe.

2 Likes

Thank you very much for looking at my log Randy. You are correct with option 3, it is running a jet with a nozzle aimed with a servo. I’ve tried enabling vectored thrust and it just creates a ton of oscillation. I tried lowering my Pids and FF and it would still oscillate terribly. Any suggestions for why it might be doing that?

With thrust vectoring disabled, I have been able to tune it to follow my waypoints fairly closely. It still suffers from the issue of if the boat skips on the water it starts to over correct terribly at a high throttle and doesn’t seem able to recover itself without me stopping the mission. I’ve tried to counter this by just lowering the wp_speeds and accel, but its not ideal still. I had hoped by lowering the STR max settings that might lower the speed it tried to turn (no attempts at 1/4 second 180 degree turns) but that didn’t seem to work. Here is the latest log if you have any further advice it is much appreciated!

https://drive.google.com/file/d/18lfB8UeKpQwFbVu3NzHqh_laAD9OYDCf/view?usp=sharing

@Flyhigh,

Thanks for the log.


Above is a graph from the turn rate controller. The desired turn rate is in red, the actual is in green so we see very large oscilliations in the actual (in green) which means that some of the gains are too high.

This graph also shows the contribution to the output from the FF (in blue), P (in orange) and I (in yellow) and it is clear that the P term in particular is too high so I think reducing both ATC_STR_RAT_P and I to 0.10 (currently 0.35) or even lower will make things better.

I still think though that this vehicle should be setup as a vectored thrust vehicle. Changing the vehicle to be vectored thrust affects the gains though so it is very possible that after making this change ATC_STR_RAT_FF, P and I should all be reduced.

If you could try setting it up as a vectored thrust vehicle and then send me the logs from even a short drive I’ll be able to give more advice.

2 Likes

Thank you. I’ll try reducing P and I and get another log with vectored thrust for you. I much appreciate your time and the advice!

1 Like

I ended up having some time this afternoon and the water was perfectly calm. I enabled thrust vectoring and I reduced P and I to 0.1 and started a session. Even at 0.1 there was still a massive amount of oscillation. So I just started reducing P and I and then reduced FF as well. In the end there was no visible oscillation and I was never able to recreate the “skip and lose its mind” issue that was happening before. So I think thrust vectoring is mandatory, thank you Randy for twice telling me to enable that! I was just surprised how low I needed to set P and I and FF to get rid of the visible oscillation. Now the issue I see is that my previous tune tracked the waypoints quite well. But this tune is quite a ways off from directly tracking the waypoints. For the river run I really need it to be tracking quite well. So i’m not sure if my tune is still off or if there is something else I need to be tuning for more accurate path following?

I am excited to see that the skip and freak out is gone, that had me worried that if it happened on the river I could lose the boat as i will likely be out of sight for sections of the river run. So I think its worth continuing on with this tune and trying to get it very dialed in for waypoint following.

Please let me know your thoughts, and thank you again for the help!

https://drive.google.com/file/d/1MC14rH9A3SyLNunowjFDmVr7ORSa55Vu/view?usp=sharing

Hi @Flyhigh,

Ok sounds good.

It looks like the steering is still oscillating quite a lot even at the end of the log when some PIDs have been reduced.

I think it might be best to actually set ATC_STR_RAT_P and I to zero and just focus on ATC_STR_RAT_FF at first. Maybe try using MP’s tuning page to view the desired and actual turn rate in real time (after setting GCS_PID_MASK = 1 (Steering)) and then adjust ATC_STR_RAT_FF up or down to try and get the “achieved” to match the “desired”. see here on the wiki. After you get this working as well as possible increase ATC_STR_RAT_P and I. As you say, it seems very low values of P and I are required… maybe start with 0.01 or even 0.005. Note that you can always enter any value for a parameter if you use MP’s Config >> Full Parameter Tree (or List) screen.

By the way, it’s possible we may need to adjust the turn rate filtering, ATC_STR_RAT_FLTE, to match the fast response of the vehicle but let’s try the above changes first.

Also ATC_TURN_MAX_G is really high at 10G. It seems like the vehicle is capable of about 1G so maybe reduce the parameter to 1 or even 0.6 (the default). Setting it too high is not helpful because it leads to the controllers attempting maneuvers that the frame is physically not capable of.

2 Likes

For future reference should I enable LOG_FILE_DSRMROT? So that logs are stopped each time I disarm? I’m getting these large logs since it keeps running I guess the entire time its got power?

I got some tuning time today before the wind came up. I think I ended up pretty close. I set FF as best I could, it seems I have more turning authority one direction than the other. Maybe due to servo isn’t perfectly centered or maybe due to centrifugal thrust from the jet. Anyways I tried to set it in between so it had a little over shoot one direction and a little undershoot the other.

I pretty much just set P and I after that and left it. I spent some time tuning Nav L1 and feel like its doing fairly well on waypoint following.

Having a quick look at the logs, it looks like pids target and achieved are pretty close without too much oscillation. There is a noticeable delay though, not sure if they should be lining up better? Charting the FF in PIDS it does seem to be very squared off and extreme?

Please let me know any further thoughts you have!

https://drive.google.com/file/d/1_4M5uy1pyUvqQUfY0rz6cuAsgN96b1IX/view?usp=sharing

I just made an attempt at running the test canal again and it didn’t go so well. I’m not sure if I just got lucky the other day with the successful run. Or if I don’t have this new tune quite as dialed in yet. All attempts at running the mission ended up with the boat off course enough to run aground.

@Flyhigh,

Thanks for the logs.

I think it would be good to raise these three parameter values:

  • ATC_STR_RAT_MAX to 90 or even 120 (currently 45)
  • ATC_STR_ACC_MAX to 120
  • NAVL1_PERIOD to 8 (currently 4.5) to reduce the navigation controller’s aggressiveness and get closer to the defaults.

Also I just want to check that the vehicle’s steering jet can move 45deg left and right? So a total of 90deg of motion? This is what’s in MOT_VEC_ANGLEMAX at the moment so just want to be sure this is accurate.

I wonder if the mission could be changed so that it is a big square or rectangle with just 4 waypoints and a DO_JUMP at the end to make it repeat the square/rectangle at least 3 times? We want to see the vehicle’s ability to hold a straight line and also how it deals with 90deg corners (or close to 90 degrees, it doesn’t need to be perfect).

1 Like

You are probably right, I just kinda guessed at what the nozzle range was. I should see if I can find a protractor and get an accurate angle measurement.

I’ll see if I can get a square with do_jump at the end. I’ve had a lot of issues with getting errors trying to use that feature in the past. But i’ll try again or else just toggle manual and back to auto for the 3 runs.

1 Like

Wasn’t able to get the square do jump to run. I had this issue when tuning my sonar boat as well. I get this error message in Mission planner when I try to upload the mission to the boats.

It was very rough today so I’m going to try and wait for a calmer time. I’m not sure the logs I would have gathered today would be accurate enough. There were a few issues with the boat skipping off waves and spinning while turning.


Here is a log from this mornings tuning. Still quite a ways off from the waypoint tracking that I’m hoping we can achieve. Please let me know your thoughts.

https://drive.google.com/file/d/1t_vUfjtOp76C61Ya0zYYGTHlcETy1Bbd/view?usp=sharing

Hi @Flyhigh,

Thanks very much for the new log. It looks like the ATC_STR_RAT_FF is perhaps 3x too high so it might be good to lower ATC_STR_RAT_FF to 0.06 (currently 0.125).

By the way, the issue with the DO_JUMP is that the command’s “WP #” field was set to zero. Try “1” and it should work. I’m actually surprised that it rejects the upload but I have reproduced it and I suppose it is better to know that something is wrong sooner rather than later.

2 Likes

Ah that does explain it. I just assumed it would jump to 1 automatically, I didn’t realize I needed to specify the jump.

So the FF is interesting, I tuned according to the steering wiki when you mentioned trying to get FF set as close as possible. And based on the live pid desired pid achieved readings it seemed to be set quite perfectly. But I do see see your screenshot and the data in the log showing the difference… I wonder why I wasn’t seeing that in the live tuning session?

1 Like

@Flyhigh,

Re why the FF seems different than during the real-time tuning, my worry is that this may be because the thrust response is non-linear. So for example 100% throttle may not produce twice as much thrust as 50% throttle. Another possibility is that it makes a large difference if the vehicle is planing or not and maybe during this test it was but during real-time testing it was not (or perhaps the reverse).

1 Like

So I did some testing tonight at FF 0.06 and this is what were looking like. Still having trouble tracking the waypoints and still way off from desired turn and actual turn. I guess maybe I need to try another test at 0.03 or 0.04 FF? Can you offer any insight on what exactly is causing the overshoot on all the waypoint tracking? I’m just running significantly off my waypoint lines still. I’m getting a bit discouraged in getting this boat tuned using thrust vectoring. While it might have been overtuned without thrust vectoring it was running waypoints quite accurately. Though I really prefer that it doesn’t’t freak out when the boat skips with thrust vector enabled.


Here is the log from tonights tune, the last run would be the one to look at. The rest of the run was just playing around with some settings. I hate to keep taking up more of your time but appreciate the help.

https://drive.google.com/file/d/1XFLLGQaVJMhH88urpw0N4i3z6nnFTtxP/view?usp=sharing

Hi @Flyhigh,

Txs again for the logs. Yes, it looks like the ATC_STR_RAT_FF is still too high so going down even further to 0.03 should help. Reducing ATC_STR_RAT_P and I to 0.005 may also be helpful.

It looks like the WP_RADIUS and WP_OVERSHOOT parameters have been set to zero which is not a good idea because it means the vehicle will never turn before reaching the corner and it will constantly be speeding up and slowing down as it travels along the straight path. Setting these back to the default of 2 (m) is probably best.

To make the accelerations and decelerations a bit more gentle it might be good to set ATC_ACCEL_MAX to 1 (currently 2).

Re whether or not to use vectored thrust, you may be right that the regular control will work better for this vehicle but we don’t know yet and it’s slightly too early to give up on vectored thrust because it’s clear that the FF is still too high. I think we should try reducing it further and then if it’s still not working well we can go back and try the non-vectored thrust method.

The key thing is we need to tune the low level controllers (speed control and turn rate control) as best we can before moving onto the higher level navigation control tuning… so let’s not worry too much about whether it’s following the mission perfectly or not yet… let’s just get the turn rate controller working and then we can figure out issues with the navigation controller.

2 Likes

I think FF is set pretty well now. Its showing a little undershoot one direction and a little overshoot the other, but overall pretty good? I did notice my speed is not tracking as well as it was previously. I have switched to 3s batteries and did rerun learn cruise. Thats all i’ve changed regarding speed tuning since the initial start of this all.

Take a look at let me know your next thoughts, thanks!

https://drive.google.com/file/d/1pk9l3Aop9BBBs2gzQEl7owB5g3WAPskR/view?usp=sharing