Autotune RC5 - concerning observations

My Tarot Pro Hexacopter has been performing flawlessly on RC5. Tonight I thought I would have a go at Autotune just to test the feature, and it flagged up a couple of very strange behavioural issues during the AT process which I thought I should share with the devs. Firstly, the log of this AT flight can be downloaded from here:

ATune process followed: As this is a hexacopter with 13" CF props, I followed the recommendation in the wiki and set filtering to 10Hz ( both ATC_RAT_RLL_FILT and ATC_RAT_PIT_FILT. Was set to 20Hz up until now).
AUTOTUNE_AGGR set to 0.1

First set to roll only and in Position Hold. Launched copter and turned such that it was pointed into wind (so roll axis across wind as instructed in wiki). Ran autotune, and these are the observations for the roll axis:

  1. It initially maintained its position despite there being 5mph winds, but within a couple of minutes started drifting down wind, with no intention of coming back - I think I read that it would occasionally re-position with AC3.5, but did not observe this. I repositioned the copter manually close to the starting position…
  2. Upon releasing the pitch/roll stick, the copter immediately yawed about 30deg and climbed a few metres. This is strange behaviour number 2! I repositioned the yaw nose into wind, and the autotune carried on and eventually completed. I switched out of autotune, then back into autotune, then landed and disarmed, then out of autotune. I then checked the PID changes made to the roll axis.
  3. Strange behaviour number 3 is that when tuning the roll, instead of twitching perfectly in the roll axis, I observed that most of the twitches were diagonal in axis.

Reconfigured to autotune the pitch axis, armed, and launched a second time (still powered on same set of batteries). This time I had the right side pointing up wind. So for the Pitch axis:

  1. Again the copter drifted from the start position and on moving it back to safety, it yawed through 90deg this time, so I corrected yaw with rudder input and it yawed a second time! Corrected again.
  2. Also observed that the twitches were being applied diagonally again rather than purely in the pitch axis. I managed to complete the autotune for pitch, land, disarm, switch out of AT etc, and again checked the changes to PIDs.

After tuning, I took it for a test flight and the copter had noticeable motor vibes on launching, but it flew responsively. I think though that my starting PIDS felt better than the ones applied by ATUNE. It eventually triggered a battery failsafe and you will see in the logs the failsafe and RTL being triggered. I switched manually to AltHold, then back to PosHold and landed manually.

So the phenomenon witnessed during the autotune procedures were at least consistent between roll/pitch axis tunes, but never the less not what I expected.

Hoping this info and the attached log is helpful to the devs to further perfect the autotune process and maybe check to see if the behaviours witnessed were actually issues, or intended behaviour etc.

Cheers, Paul

Pitching in here: I just did some autotune yesterday, and also ran into problems with yaw during poshold autotune. Suddenly during tuning the copter would yaw about 90 degrees and I would have to compensate.

Autotune from althold does not give me any problems, so something’s up here.

Attaching log if it helps anyone.21 1-1-2000 3-53-50 PM.bin (2.9 MB)

Thanks olie, was wondering if someone might respond. Think we might have uncovered an issue. Hopefully the devs will see this post.

cant we log issues to the git?

Absolutely. But I would like them to take a look at the log first to see if they can validate this as being a proper issue first.

was looking at the wiki today, the new autotune as a flight mode
what mode do you have to be in to move into autotune, I just get restricted flight mode

I observed this today
Canceled out of autotune
will have a log shortly if you want it

I haven’t looked at your logs as this isn’t my area of expertise. I’ll just add some points:

  • the new position hold of autotune is very light to have a minimal interference in the autotune results; specifically it will only go to a maximum lean angle of 10 degrees and will only reach that maximum at 20 meters from original position
  • with this new method it will also yaw the vehicle to try to use the wind in its favor
  • if you control the vehicle with the sticks it will override the position hold
  • the old method without position hold still exists, it will only use the new method if your previous mode was Loiter or PosHold

Regarding the yaw - It did not yaw the copter in my case to make the heading in its favour - it yawed it to be 90deg out of favour, so I think for the PosHold autotune, something needs 'autotuned’
in there :slight_smile:

How was it out of favor? What axis was it tuning and when it yawed in what axis was the wind blowing?

In tuning the pitch axis, I had it planted with the wind 90deg to this (wind on right side) and it yawed 90deg almost. That is surely out of favour with the suggested method in wiki?

Any response to my comment about the twitch being diagonal,rather than in the tuning axis? I expect my log should show that.

I didn’t write the position hold feature but I plan to write up the new method on the wiki in the near-ish future.

I think the way the yaw control works is that it attempts to turn the copter so the axis being tuned is perpendicular to the wind. We don’t have wind estimation in Copter (yet) so instead what it does (i think) is when the vehicle strays 10m from it’s starting point it yaw’s the vehicle. So I think of it a bit like a 10m circle around the starting point, whenever it breaks that 10m barrier it will yaw the vehicle.

Cheers Randy for the explanation. I think I’ll stick to AltHold though for Autotune from now on as it yawing like this is a bit disconcerting. I’m happy that i got both pitch and roll tuned on one battery (well, two in parallel, given this is the norm for this copter). I might play some more with Autotune to see how I can improve the results on this copter as getting a good tune n this is important to me being my main camera platform. To be fair, the tuning before I started was better than what came out of AT, but will run again with different AUTOTUNE_AGGR values to see how this affects the outcome. It was set to 0.1 this time.

That actually sounds like it might be working as coded then

After reviewing the autotune position hold code last night, we discovered that it was resetting the target position when any of the pilot’s sticks (including yaw and throttle sticks) were moved away from the center. We think that it would be better to only reset the target position if the roll or pitch sticks are moved so we have patched this and will release this as part of the next release candidate (AC3.5-rc7) which will go out later this week.

Thanks again for beta testing and bringing this up!

This has been my experience after about 10 different tunes.
It seems to figure wind direction pretty well.

My only issue is the constant hunting for home point which seems to change dynamically. This behavior is really pronounced on the yaw axis tune.

By the way, I’ve updated the autotune wiki page with information on the position hold feature and also added a “common problems” section.