QAUTOTUNE - VTOL autotune for quadplanes

Yeah that’s becoming more clear the more flights we make/learn about contextual parameters.

We’ve just done basic PID tunes first looking at the aircraft visually and then the desired angle/actual angle logs and graphs. I tried to replicate autotune movements by jamming the sticks in pitch/roll and we felt comfortable moving forward once we saw the aircraft was taking & responding to the inputs very happily.

I think the problem might have been the PWMs. Our ESCs ranges are at 1250-1800us, we’re going to retune and try to autotune again once we feel comfortable. For example, I’ve attached a picture of the first twitch from the last accident after the Accel changes. The plane jumps from 1600 to 1200, inadvertently turning the motors off.

1 Like

We were using QStabilize to tune the vehicle, we never tried to see if QHover was flying well before trying autotune.

Okay thank you for the clarification here. After we have that value learned and saved, should we turn off hover learn, or let it continue to rewrite itself?

I agree that the tune is likely unstable at this point, when we fly it around the field it seems to handle maneuvers fine (max pitch and roll), but I guess that doesn’t mean that its tuned to the point it can enter auotune yet. We are still seeing a lot of overshooting in the response , from what youre saying since were having overshoot problems the autotune will terminate after the initial twitching test.

We followed the procedure on this page :
https://ardupilot.org/copter/docs/tuning-process-instructions.html

Specifically the manually tuning of roll and pitch section. We may need to dial in P more for pitch and roll. Should we follow this section exactly, specifically setting the I term equal to the P term each time, and doing the D terms before the P terms?

Here is a log for a flight done today after addressing the motor parameter issues, as @ohitstarik says above he was jamming the sticks to test roll and pitch.

Just to be clear. That page is a step by step guide to doing a tune. I do not skip a single step when I do an industrial tune. I wrote it with the goal of giving the community something they could print out and literally cross of each line one at a time until they get to the end.

https://ardupilot.org/copter/docs/tuning-process-instructions.html#evaluating-the-aircraft-tune

Turning FF off enables you to test the disturbance recovery.

https://ardupilot.org/copter/docs/tuning-process-instructions.html#test-althold

No, Autotune immediately terminates the test if it exceeds 20 degrees but it assumes this was a disturbance of some sort and continues to repeat the test after the aircraft is stabilised.

This is absolutely critical to achieve a reliable tune. The more D you have the more P you can have. So by setting P first you end up with a much lower P term because the D term is lower when you tuned P. After a good tune you can’t reduce the D term without reducing P and I by the same percentage because reducing only D will probably cause a P term oscillation.

I only see pitch but as you can see it is struggling a bit there.

3 Likes

Thank you for the detailed response and tuning clarifications.

Didn’t realize QHover was the quadplane version of althold until now.

This helps a lot! Looking forward to testing it tomorrow.

1 Like

Hi @Leonardthall ended up with a successful day and got AUTOTUNE to work with pitch and roll successfully.

We ended up using an aggressiveness of 0.05 and was wondering if increasing the aggressiveness tends to provide significant stability improvements, or if 0.05 is suitable for larger frames.

Also would increasing the minimum autotune D value decrease the time spent in autotune mode?

Thanks to you and Leonard for all the info in this post. Most helpful. I’ve had some issues using Autotune with my Skywalker and found this info most interesting.

1 Like

In general you should always start with AUTOTUNE_AGGR set to 0.1. This is a conservative value and there is no reason to go lower here. This value defines the overshoot plus noise. In a perfectly clean aircraft the ideal value for disturbance rejection is 0.1 but 0.05 is ever so slightly faster. So when you factor in a little noise you get a nice safe range. The risk to going lower is any noise on your system can quickly cause autotune to fail so 0.1 or 0.15 for a noisy aircraft are good. (fix noise if you have it use 0.1).

2 Likes

We have a large VTOL aircraft that can only hover for 4 minutes, while attempting to autotune roll axis it took too long and we had to land before it was complete. Landed in Autotune mode and disarmed but the tune seems to have not saved. Is there a way to complete it faster or land and continue after a battery swap?

Tried Qautotune in pitch to see what sort of improvement could be made to the aircraft but kept getting the ‘failed to level’ message. Could having a q_trim_pitch offset be an issue?

You need to do a manual tune. Autotune requires your tune is good enough to effectively level the aircraft and recover from a disturbance disturbance.

Okay I’ll have to give it more attention - thanks for the quick reply. I just assumed it was able to handle autotune because I was pretty happy with the responsiveness after setting the params outlined in Tuning Process Instructions — Plane documentation.

What is the tolerance on that levelling requirement out of curiosity?

Also while letting the autotune run, it was moving around a bunch ~10 m radius circle (no wind, engaged from QLoiter). Do you think that is related, expected, or a separate issue?

It could be your position control tune too if you are using Loiter. You could try from Alt_Hold. The aircraft will drift but there is less going on.

Okay worth trying thanks - It does hold position really well generally in Qloiter but it will be easy enough to give it another shot from Qhover. I know for certain the Yaw tune is poor (still transitions fine) but does that need to be good for Qautotune in Pitch to succeed?

No, as long as the reaction in Yaw isn’t large enough to mess up the pitch measurement. So I don’t expect so.

I am trying to qautotune a tailsitter and after about 6 minutes or so, it stops twitching. When I land without changing mode, and then disarming, I do not see any of the PIDs changed. I am basically saving the parameters to a file and looking for changes. Is there an indication that qautotune finished or has not (something in the log/visual on mission planner)?

I’ve been trying for a few days without any success.

https://ardupilot.org/plane/docs/logmessages.html?highlight=autotune#atun

Thanks, I don’t have ATUN in my report, but I have QTUN (which I guess makes sense since it’s a qautotune).

I am not sure how to know if tuning is complete.

I just checked an old log with qautotune, and it is full of messages like

2019-09-05 08:51:57.830 AutoTune: Twitch
2019-09-05 08:51:58.357 AutoTune: (R) Rate D Down
2019-09-05 08:51:58.357 AutoTune: WFL (Angle(R)) (6.557760 > 5.000000)
2019-09-05 08:51:58.357 AutoTune: p=0.108072 d=0.011298
2019-09-05 08:51:58.357 AutoTune: success 2/4

and in addition to QTUN, it has ATUN records that look like this:

2019-09-05 08:54:51.94: ATUN {TimeUS : 446577116, Axis : 0, TuneStep : 4, Targ : 10.340813636779785, Min : 8.9099998474121
1, Max : 9.59000015258789, RP : 0.21025855839252472, RD : 0.007890054024755955, SP : 12.53683090209961, ddt : 89641.609375
}

TuneStep runs from 0 to 4

So I expect you should have ATUN records in your log too.

Unfortunately, I don’t these messages. Here is a link to my bin:

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

You never entered QAUTOTUNE mode in that log, which explains the lack of ATUN records.