QAUTOTUNE - VTOL autotune for quadplanes

Ok, thanks for the clear assessment. Thats what I was considering too. I thought my D gains were already quite low, but obviously i will lower them further and be more cautious regarding vibrations before starting the Autotune.

So you recon the PIDs were the main problem? That spike in the graph above is not some sensor failure/reset because of wrong parameters or anything, but it was actually the first normal cycle of autotune? I would like to understand it from the data.

Btw on the Quadplane parameter page https://ardupilot.org/plane/docs/quadplane-parameters.html it says:
" The most critical tuning parameters are Q_A_RAT_RLL_P and Q_A_RAT_PIT_P. These default to 0.25 but you may find significantly higher values are needed for a QuadPlane."

I think this gave me a completely wrong feeling about those parameters. My initial try was 0.3 based on that and the plane flipped right at the start, thats why I was rather positive how it went this time. Of cause I am just one point of experience, but my VTOL should be a rather average setup. Maybe it should be considered weather the documentation should be updated?

Hi Dave,

If you have any oscillation then you can’t proceed with Autotune.

The good news is I don’t see any oscillation in yaw. Can you show where you think you see it?

You do have some high frequency noise at about 80 Hz that you would benefit from removing with a notch or harmonic notch depending on where it comes from. A batch fft log would be the way to go here see what it shows.

Your filter settings look ok otherwise though.

In any case I would add the notch filtering after the FFT log flight before proceeding to Autotune. I suspect you would get away with it though. I just would do the setup properly first.

Yes that is correct.

Your log looks like it is oscillating in both Alt Hold and pitch. So I would read through the instructions above and make the appropriate changes I describe there. If you follow the instructions step by step you should do well.

Hi Leonard,

Thanks for the quick reply, Attached, please find an image of dyaw and yaw. I circled the part that I am bit concerned about.

I’ve never used FFT logs before. I do see the 80 hz noise in the IMU plot. Is the what I should filter out?

Df log attached link below.

Thank you. I really appreciate your time and experience.

Dave

Ok, I set up a harmonic notch filter linked to the throttle.

Did a few test flights. Everything looked good, so I proceeded with an autotune. First thing I noticed was a sharp yaw to the left, which surprised me because autotune is supposed to start with roll and I had Q_AUTOTUNE_AXES set to 1.

I gave it a few more minutes and didn’t like what I was seeing so I abandoned the autotune.

A few concerns:

The autotune seems too aggressive for a 2m QPLANE. Q_AUTOTUNE_AGGR is set to 0.1. Should I lower this to .05. AUTOTUNE_LEVEL is set to 6, which is default and consistent with the recommendation. Should I reduce the level?

The other concern is current draw during the autotune. It spikes to 160 amps. The four ESCs are rated at 60 amps and the Mauch Power module is rated at 200 amps. But the battery, connector, esc and engines are getting warmer than desired. I am concerned it may get too hot during an autotune. I plan to do one axis at a time, land, let it cool and do the next axis. And I am thinking reducing the aggressive may reduce the current spikes?

Long term I am not too concerned about the heat because we only plan to be vtol for a few minutes for takeoff and landing.

Any suggestions about how to proceed are greatly appreciated.

Thank you,

Link to the log for the attempt at tuning. It consists of two test flights and the autotune flight.

That is not oscillation. Oscillation is very regular and will look sinusoidal or at very least like a saw blade of some sort.

I am not sure what you want to show in that log but I didn’t see the batch fft logging there. Did I miss something?

This does not impact the tests just the choice of parameters. Three currently isn’t any way to reduce the maximum twitch request.

A quick look at your log doesn’t show any signs that I would be worried about. I can’t evaluate your power system but assuming it can take it I would proceed with autotune.

Lovely to see life return to the thread :heart_eyes:

We went autotuning recently and only managed to finish around the pitch axis. I’ve read previously that the PID’s are saved even if the autotuning did not finish completely. This seems to be wrong or maybe we are missing something.

Best of luck to everyone

Hello All,

I attempted another QAUTOTUNE today. It started out ok, but progressively deteriorated to a point where I was no longer comfortable continuing. My concern is large movements in the yaw and pitch axes while I am tuning the roll axis. I understand some motion on the other axes is normal, but both yaw and pitch seemed excessive and borderline unstable. At one point, the nose pitched down 35 degrees. Yaw is literally all over the place with several 180+ swings.

The winds were calm.
Vibrations look good
CG is at the recommended location.
The engines are close to the same PWM while hovering.

Not sure what else to check. But don’t have confidence in moving forward with the tune.

Attached, please find an image Des Pitch, Des Roll, Des Yaw. and a link to the log file.

Thanks,

Dave


Ahhhhh, I know what is going on!!!

You are starting autotune from Q_Loiter. This does a bunch of stuff for you like keeping you pointed in the right direction and fighting drift.

If you start it from Q_Hover then you will have to do all that yourself. I do it all the time like this so I didn’t think of it.

Basically do it on a calm day in a big field and let it drift with the air. Try to keep the axis being tuned 90 degrees to the air flow. ( I am deliberately not saying breeze or wind because you want really calm).

Sorry this did not click earlier!

Thanks Leonard. I’ll let you know how it goes.

Well another frustrating day in my drone building life. Went to the field twice today. Two takeoffs, one landing and one crash.

Earlier today, we tried an autotune. The winds were calm when we started but picked up during the flight. Again the VTOL wasn’t responding to the tune as expected. We abandoned the tune and attributed performance to the wind.

Hours later, the wind was calm. If not zero very close. So we decided to give it a go again. Charged the battery and full of optimism to the field we went.

Took off in qstablize, selected q hover, climbed to 30 meters and initiated the tune for the roll axis only. Again, I was quickly concerned about what I was seeing. While responding to roll, the drone would often move back and forth aggressively. I expect some movement but sometimes it would quickly, almost violently, slide 10m aft. Despite my concerns, I continued the tune. I had to re-position the drone several times. Each time the tune would resume. At one point, I had to be close to the end of the tuning process, the drone spun out of control. I quickly deselected tune and was hoping for a recovery. No joy! Sucks! Total loss. Foamies don’t do well when they impact the ground. Although I am not sure any material would survive the impact.

My initial thought was an ESC desync. I don’t see any evidence of that in the log. Additionally, the vibes, batt voltage, Vcc to the Pixhawk 2.1 look good. I don’t know what else to check.

No indication of physical failure. All props intact although forward two broke on impact.

GC is slightly forward for plane.
While hovering, the drone is fairly stable. It doesn’t move forward or aft, suggesting the front motors are vertical, It doesn’t move left or right. In a hover, PWM to the engines is around 1500 for all engines.

The build seems solid but I am obviously missing something.

Log attached.

Any help is greatly appreciated.

Thank you,

Dave

Hi Dave,

That sucks, I am very sorry to hear about your crash!

I know it is too late for you now but in general Autotune should move in one axis at a time and recover pretty cleanly back to level. Autotune is only running during that very short twitch. Other than that it is running Alt_Hold or Loiter. So if it is not recovering cleanly then either the starting tune needs work or there is another problem like sync loss.

In this case it does look like desync. It appears you are getting partial desync on numerous occasions through that tune.

I assume you calibrated your ESC’s. Your min throttle is set to 15%. This is all ok assuming you are not using ESC’s with a fixed pwm range. If you are using BLHeli esc’s you have some options to reduce desync. If not, all you can really do is increase your Q_M_SPIN_MIN value.

Sorry again Dave!

Leonard,

Thanks. Can you show me what desync looks like?

Thank you

Here is the final suspected desync:

This shows one of the earlier twitches in contrast to a normal twitch:

See what I mean?

Thank you. Looks pretty nasty.

I tried to incorporate all of your suggestions above to prevent this from happening. Is there a particular brand or type of ESC that limits the possibility of desyncs. This build used HW X-Rotor 60 AMP ESC.

Again, I really appreciate your time and expertise. While I am frustrated, this community keeps me going.

Dave

BLHeli esc’s tend to give you the most flexibility when dealing with these issues and HobbyWing tend to be good quality.

I do a bunch of testing to work out BLHeli ESC settings when I see issues but in general there are a few directions you can go:

  • Set Demag compensation to High
  • Increase motor timing to 20 to 25 degrees

And increase your minimum throttle in the autopilot parameters a little.

Hey, we’re trying to autotune the yaw axis and we’re doing 12 minute flights without completing the tune. What would you suggest could help? A higher aggressiveness? A mechanical issue? We have a bit of play in the linkage between the tilt arm and the servo, possibly one or two degrees of rotation. Could that be enough to ruin the tune?

Pitch and roll tuned nicely.

Thanks Leonard!

It’s maddening my post must be at least 20 characters. Why can’t I just say thanks.

Bin from our flight

Ping @tridge @iampete - sorry to bother you but if you find time could you take a look at these? We did a twelve minute tuning flight but did not manage to complete it. Is there any way to get the values from the bin file? We’re thinking of plugging those values into the parameters and manually tuning from there.

If you look at the ATUN message you can track the progress of the autotune. See the description for parts of the log messages. (they are a little out of date but still correct, improvements to longing documentation coming soon) This gives the rate P and D, auto-tune just sets I = P. So you can fill out your Q_A_RATE_YAW P, I and D to where you got to. It also gives the angle P gain.

I would fill out these four values and carry on your autotune on a fresh battery, yaw always takes the longest, it will get there in the end.

edit: a few corrections, I = P is only for roll and pitch, for yaw use I = 0.1 * P. Again as this is yaw the rate D is always set to 0.

1 Like