Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPFG: Add fallback for corner cases #22411

Merged
merged 5 commits into from
Dec 5, 2023
Merged

NPFG: Add fallback for corner cases #22411

merged 5 commits into from
Dec 5, 2023

Conversation

KonradRudin
Copy link
Contributor

@KonradRudin KonradRudin commented Nov 20, 2023

Solved Problem

The NPFG controller can't produce reliable roll setpoints when the wind estimation is not yet valid and the ground speed is close to zero or the vehcile is pushed back by the wind. This is a more general fix for #22003

Fixes #{Github issue ID}

Solution

  • Add a new function evaluating if the npfg controller is able to produce reliable roll setpoint.
  • Make a smooth transition from using the npfg output to keeping the current roll angle when the npfg output becomes unreliable.

Changelog Entry

For release notes:

Feature Add NPFG fallback for cornercases without valid wind estimates

tstastny
tstastny previously approved these changes Nov 23, 2023
Copy link

@tstastny tstastny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KonradRudin thanks for the sanitizer! great to handle these cases now. However -- see the comment about blending to zero instead of last roll setpoint. I approved because I'll be out of office and unable to approve later... but I actually think blending to zero is the better solution in the degraded input cases. If there are strong reasons I am wrong about this .. please feel free to discuss also with @RomanBapst and @sfuhrer and you three can override my opinion ;)

src/modules/fw_pos_control/FixedwingPositionControl.cpp Outdated Show resolved Hide resolved
@KonradRudin
Copy link
Contributor Author

Rebased on main

Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed I would add some user notification when the factor drops below 1 (but has been above 1 before).
And I would consider reducing COM_VEL_FS_EVH by default a bit, as it would be bad if NPFG doesn't control roll any more because the estimator reports a very high velocity uncertainty but there is no failsafe action triggered.

src/lib/npfg/npfg.cpp Outdated Show resolved Hide resolved
src/lib/npfg/npfg.cpp Outdated Show resolved Hide resolved
src/lib/npfg/npfg.cpp Outdated Show resolved Hide resolved
sfuhrer
sfuhrer previously approved these changes Dec 4, 2023
Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now! Let's clean up the commits and bring it in then.

@KonradRudin
Copy link
Contributor Author

Squashed the commits and rebased on main.

@sfuhrer
Copy link
Contributor

sfuhrer commented Dec 4, 2023

@KonradRudin can you check if the CI failures are real?

…e test buffer

There were already checks at runtime, but this ensures the format is not
too long at built-time.
@sfuhrer sfuhrer merged commit c5101c7 into main Dec 5, 2023
88 of 90 checks passed
@sfuhrer sfuhrer deleted the add_npfg_failcase branch December 5, 2023 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants