Skip to content

Conversation

@avsaase
Copy link
Member

@avsaase avsaase commented Sep 18, 2021

Autotune is really only about setting the correct rates and FF so that the rotation rate roughly matches the rate command. It does a decent job of figuring out the correct values but on most flying wings this means low pitch rates and conversely high FF. We currently don't have a real way of tuning P, I, and D so these are set relative to FF. However, with these high FF gains, this means very high P and I, making flights rather bumpy and stiff.

INAV's fixed-wing defaults for P and I are safe for basically all planes, so it is better to just leave them as they are during autotune and let the user tune them manually if he so desires. Once rates and FF are set correctly, P and I are mostly a personal preference thing and not something that needs to be set to a correct value to keep the plane in the air.

I'm still thinking about a way to tune P, I, and D independently but until then I think it is better to just not change them.

@0crap
Copy link
Contributor

0crap commented Sep 20, 2021

Should have been like this from the start.
Currently users think they have tuned their PID's, while it's in fact totally not.
Ending up with bumpy and stiff results like mentioned by avaase.

Totally agree with this one!

@b14ckyy
Copy link
Collaborator

b14ckyy commented Sep 27, 2021

So time to use this and then make a manual PID tuning guide :D
I like the idea in general. Hopefully we will find a good way to tune PIDs too

@StuweFPV
Copy link

Totally makes sense! I agree with that request

@StuweFPV
Copy link

StuweFPV commented Nov 2, 2021

I'm not sure if this is the right place to mention this but it goes into the same direction of what AT should or should not do:

  • it would be cool if there is a "strength" setting of AT - kinda like the "smooth" factors 1-9
  • more important i truly don't like AT to tell me the rates of my plane. example: i generally fly around 330-360 roll rate with all my planes. super cool when i could tell that inav and then AT found the right FF. now i took my tester, a little ZOHD XL and the new settings after a full AT flight are, that i now have a roll rate of 550-600 degrees. yes the plane is capable of that. but my flying style is not like that. It is a big advantage when i can tell all my planes how to behave in a roll so i'm used to the stick input rather then the plane tells me what it can do and how i have to fly it. It feels like 20 years ago where we had to tune and trim the plane with the help of servo hole, limitations and expo...

So i'm at the point where i better don't use AT anymore since v3. Going forward i will install 2.6.1, find with the help of AT my desired FF, upgrade to v3/4 (I looove the permanent servotrim!), manually set the FF and manually do my PID's like in the past - never touch AT again!
thanks for all your work!

@b14ckyy
Copy link
Collaborator

b14ckyy commented Nov 2, 2021

@stuwe911
Point 1: Autotune tunes the FF value so the rough control surface deflection gives the physical rate that INAV expects and the PID controller has less work to do. There is no Soft or Stiff tune. You can set P, I and D to 0 and fly with FF only and it will be the same as if you fly in Manual. Therefore such an option makes no sense.

Point 2: You can set the Autotune mode in the CLI to "Limit": set fw_autotune_rate_adjustment=LIMIT
Then you set your desired maximum rates in INAV before you do the autotune. INAV will then not raise the rates above these values but it will reduce them if the plane is not capable of reaching them. You can also set the rates as FIXED and you will gett back the classic 2.6 tuning. But then you MUST getthe physical limits of the plane first or you will get problems, especially on Pitch.

@StuweFPV
Copy link

StuweFPV commented Nov 2, 2021

excellent feedback. thank you very much for that valuable info. I'll try this out shortly if the weather permits

@StuweFPV
Copy link

StuweFPV commented Nov 5, 2021

@b14ckyy I did some test flights today set to LIMIT. it all worked well! The pitch got changed down but the roll did not go from 330 up to 500 as it does on AUTO. FIXED did just what it says - no changes at all. going forward i will set my default inav code that i put on all new planes to LIMIT for the initial AT flight to get the FF and then never touch AT again. Thanks for that info - it was very helpful!

@b14ckyy
Copy link
Collaborator

b14ckyy commented Nov 10, 2021

@DzikuVx will this be merged for the 4.0 release? Just working on my manual tuning video and would like to give the correct advise for 4.0. I have tested a few planes now with new default PID+Autotuned FF and Rates and it works much better than current PI-Tune.

@DzikuVx
Copy link
Member

DzikuVx commented Nov 12, 2021

@avsaase this should go 4.0 or not?

@avsaase
Copy link
Member Author

avsaase commented Nov 12, 2021

I think this can be merged. Autotune is far from perfect with this change but it won't hurt anyone and will make it easier to tune manually.

@avsaase avsaase added this to the 4.0 milestone Nov 12, 2021
@avsaase avsaase added the Release Notes Add this when a PR needs to be mentioned in the release notes label Nov 12, 2021
@avsaase avsaase merged commit 67bc9c4 into master Nov 12, 2021
@avsaase avsaase deleted the avs-no-p-i-autotune branch November 12, 2021 14:38
@b14ckyy
Copy link
Collaborator

b14ckyy commented Nov 12, 2021

Added to the release notes. Thanks

@DzikuVx
Copy link
Member

DzikuVx commented Nov 12, 2021

@avsaase could you please cherry pick to release branch?

@b14ckyy
Copy link
Collaborator

b14ckyy commented Nov 15, 2021

@DzikuVx @avsaase
Hey guys. Seems like the PR did not make it into the RC1 yet? Just wanted to make sure it does not get missed :)

@avsaase
Copy link
Member Author

avsaase commented Nov 15, 2021

I'll cherry-pick it to the release branch this evening.

@avsaase
Copy link
Member Author

avsaase commented Nov 15, 2021

I'll cherry-pick it to the release branch this evening.

Okay, done.

@ahmadhassan11
Copy link

hi

The value of p_roll in pid settings automatically becomes zero after refresh
Someone can guide me to fix this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release Notes Add this when a PR needs to be mentioned in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants