inav icon indicating copy to clipboard operation
inav copied to clipboard

Zero throttle during RTH disables i-term for yaw

Open theArchLadder opened this issue 10 years ago • 31 comments

During the landing phase of RTH, it looks like zero throttle with stick arming disables the i-term for yaw, so the heading will not be locked in.

On the other hand, with i-term active, i had problems with windup when my quad had landed, i guess the uneven terrain gave a small heading change on touchdown that could not be corrected with the landing legs on the ground. This windup made two of the motors spin up at high rpm.

Not sure what the best solution is, how about having i-term active but more constrained?

theArchLadder avatar Apr 10 '16 20:04 theArchLadder

I tend to agree with this observation. During todays experiments with Yaw I term I ended up in a situation that caused loose of stability and crash. I have low yaw performance and when mixer was trying to satisfy yaw it had not enough power on other axises. Either that, or prop broke in mid air...

DzikuVx avatar Apr 10 '16 20:04 DzikuVx

I've noticed this too. if I throttle down during RTH land then yaw lock is lost, even with airmode on.

stronnag avatar Apr 10 '16 20:04 stronnag

@DzikuVx betaflight 2.5.2 has this in the changelog: "Added piroutte protection during hard yaw manouvres. Yaw should not dominate over roll and pitch in some scenarios" Sounds like something that could be helpful for you...? Has this been implemented in iNav?

theArchLadder avatar Apr 10 '16 20:04 theArchLadder

@theArchLadder No, it was not. Perhaps it's worth taking from betaflight. @digitalentity it was introduced via c9a35d278d97963ae82c03a57ec93f161bee94f3 but I don't think it would solve my problem

DzikuVx avatar Apr 10 '16 20:04 DzikuVx

@DzikuVx yes, it's definitely worth taking. However here is the interesting part - it's not part of betaflight anymore...

digitalentity avatar Apr 11 '16 01:04 digitalentity

It would be better to prevent integration or even reset yaw integral if requested yaw rotation rate is high enough.

digitalentity avatar Apr 11 '16 01:04 digitalentity

@DzikuVx, @theArchLadder, @stronnag Can you confirm that the issue is still present with latest master? I believe #160 should fix it.

digitalentity avatar May 04 '16 03:05 digitalentity

As soon as I will be able

DzikuVx avatar May 04 '16 07:05 DzikuVx

I just remembered this on the last RTH i did just now. Based on this single test it did look like this issue is still present, when i cut the throttle the yaw started to wander and it had different behavior on the ground depending on throttle at zero or not.

Will hopefully do more tests later today.

theArchLadder avatar May 04 '16 10:05 theArchLadder

@theArchLadder, I've deliberately reduced PID authority at throttle below min-check (similar to way it's done in Betaflight). Maybe issue is this line: https://github.com/iNavFlight/inav/blob/master/src/main/flight/pid.c#L271

digitalentity avatar May 04 '16 10:05 digitalentity

@digitalentity, sorry, i don't understand. This issue is about no i-gain when throttle is at zero, how is "reduced PID authority" related to this?

I think it would make sense to limit the authority of i-term so that we do not have so much windup/spool-up of the motors while on the ground, this seems like a separate issue, but perhaps this is what you meant?

theArchLadder avatar May 04 '16 10:05 theArchLadder

Heading lock overrides rcCommand[YAW] to maintain heading. Zero throttle + stick arming blocks rcCommand[YAW] at low throttle, so it's possible that the issue is in stick arming, not I-term itself

digitalentity avatar May 04 '16 10:05 digitalentity

That does sound more likely, but why would the heading change then?

theArchLadder avatar May 04 '16 10:05 theArchLadder

Blackbox log will clarify the situation if you have one.

digitalentity avatar May 04 '16 10:05 digitalentity

I-term reset at zero throttle finally confirmed. EDIT: It's not actually reset, but a side-effect of low-throttle PID attenuation.

digitalentity avatar May 09 '16 01:05 digitalentity

Should be fixed now. I-term at zero throttle requires AIR MODE to be enabled. This commit doesn't attenuate I-term at zero throttle and also fixes some bugs in anti-windup handling.

digitalentity avatar May 09 '16 01:05 digitalentity

Please test and re-open if still present.

digitalentity avatar May 09 '16 01:05 digitalentity

I just tried RTH with zero throttle now. It does not change the heading at all It goes up in altitude, but it does not care about altitude when flying home so it sort of slowly falls and crashes at the home location.

Works as expected with mid throttle though. Not sure if i can re-open this issue myself...?

theArchLadder avatar May 10 '16 12:05 theArchLadder

@theArchLadder so it does change heading or it doesn't change heading? Also do you stick arm?

As for loosing altitude during RTH - interesting. This shouldn't happen - pilot should be locked out of altitude control at RTH. Can you open a separate issue for this phenomenon?

digitalentity avatar May 10 '16 12:05 digitalentity

@digitalentity Sorry, it does not. Yes i use stick arm.

I will open a new issue in a moment.

theArchLadder avatar May 10 '16 12:05 theArchLadder