inav icon indicating copy to clipboard operation
inav copied to clipboard

Apply I-term relax on FW

Open avsaase opened this issue 3 years ago • 11 comments

Replaces I-term limiting based on stick position. Needs testing to determine if the 15Hz cutoff used for MR is suitable for FW. Use set debug_mode = ITERM_RELAX to log the I-term relax factor and display it on the OSD with element 78.

@b14ckyy wanna test?

avsaase avatar Jul 19 '21 06:07 avsaase

Happy to test. Is this to reduce bounce backs? Then the Raphax should be a good candidate.

b14ckyy avatar Jul 19 '21 07:07 b14ckyy

@avsaase 4.0 or not? I want to cut 4.0 in the next week but the call us up to you

DzikuVx avatar Nov 06 '21 14:11 DzikuVx

I haven't been able to test this unfortunately, and I probably won't in the near future either. I think this changes makes a lot of sense but, unless someone else can confirm this works as expected, I think we should include this in 4.0.

avsaase avatar Nov 06 '21 18:11 avsaase

Damn I totally forgot about that. Can someone make me a build please? I reinstalled my WSL completely here and my build environment is completely messed. Then I could test it tomorrow.

F722WPX and F405SE as I am not sure yet what Plane I will take with me tomorrow.

b14ckyy avatar Nov 06 '21 22:11 b14ckyy

This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. This issue / pull request will be closed if no further activity occurs within two weeks.

stale[bot] avatar Jan 09 '22 01:01 stale[bot]

This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. This issue / pull request will be closed if no further activity occurs within two weeks.

stale[bot] avatar Apr 18 '22 18:04 stale[bot]

@avsaase what should we do with this one?

DzikuVx avatar Apr 18 '22 18:04 DzikuVx

Seems like a perfect solution for this issue #8200 I'm not a coder but I'll give it a try to see if I can compile a hex on top of 5.1.0 with this PR. Just above it says "This branch has conflicts that must be resolved", not sure what that is about...

0crap avatar Jul 22 '22 10:07 0crap

Crap, I'm stuck, copy and paste shows a difference in src/main/flight/pid.c on line 774.

When the original PR was created this was not there before. const float rateTarget = getFlightAxisRateOverride(axis, pidState->rateTarget);

@avsaase can you help out please so I can test this?

0crap avatar Jul 22 '22 11:07 0crap

Got something compiled based on v4.1.0. 💯 If my wing does not fall out of the sky I can get in some results!

I have no idea what "OSD with element 78" is. But debug mode is set to ITERM_RELAX.

0crap avatar Jul 22 '22 18:07 0crap

Results are in, just back from the field!

iterm_relax

Unfortunately it's not an improvement yet. I tested mostly rolls and a few loops.

At the end of the roll there is a large amount of additional roll when the stick is already back at center. In other words, it's not stopping the roll on a dime.

The BBL shows why. i-term relax

For some reason i-term is growing like crazy during the roll and unwinds when the roll stops. I hope @avsaase can improve on this.

I was able to set the iterm_relax_cutoff using the OSD. I tried values between 5 and 30 but could not notice any difference in flight.

Let me know if I can help with any additional testing. Target is MATEKF405

0crap avatar Jul 23 '22 12:07 0crap

@avsaase Why did you close this one? I-term relax on Fixed wing would be a very welcome improvement.

0crap avatar Mar 23 '24 18:03 0crap

I'm not flying INAV anymore, or much at all. There were also some conflicts that would need to be resolved. If someone wants to pick this up again they are free to continue with the commits from this PR.

avsaase avatar Mar 23 '24 20:03 avsaase

I'm not flying INAV anymore, or much at all. There were also some conflicts that would need to be resolved. If someone wants to pick this up again they are free to continue with the commits from this PR.

Fair enough! I hope someone can use your PR for some inspiration.

0crap avatar Mar 23 '24 20:03 0crap