Zero throttle during RTH disables i-term for yaw
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?
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...
I've noticed this too. if I throttle down during RTH land then yaw lock is lost, even with airmode on.
@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 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 yes, it's definitely worth taking. However here is the interesting part - it's not part of betaflight anymore...
It would be better to prevent integration or even reset yaw integral if requested yaw rotation rate is high enough.
@DzikuVx, @theArchLadder, @stronnag Can you confirm that the issue is still present with latest master? I believe #160 should fix it.
As soon as I will be able
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, 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, 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?
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
That does sound more likely, but why would the heading change then?
Blackbox log will clarify the situation if you have one.
I-term reset at zero throttle finally confirmed. EDIT: It's not actually reset, but a side-effect of low-throttle PID attenuation.
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.
Please test and re-open if still present.
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 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 Sorry, it does not. Yes i use stick arm.
I will open a new issue in a moment.