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

Refactor uncommanded descend Quad-Chute #21598

Merged
merged 3 commits into from
May 31, 2023
Merged

Refactor uncommanded descend Quad-Chute #21598

merged 3 commits into from
May 31, 2023

Conversation

RomanBapst
Copy link
Contributor

@RomanBapst RomanBapst commented May 16, 2023

Solved Problem

The current implementation of the uncommanded descend quadchute revealed two issues:

  1. It was possible for a vehicle to enter a limit cycle in which it would stall, lose a lot of altitude, recover, slightly climb up, stall, ...
    This behavior has been observed on a vehicle that suffered an airspeed sensor failure and was flying with a too low trim throttle value. In the phases during which the vehicle climbed after recovering from the stall, the quadchute height rate error integral (current implementation) was reset to 0 and therefore quadchute never triggered, although the vehicle lost close to 100m altitude.

  2. Users found it difficult to tune the quadchute as there was no one to one relation between the parameter value and the actual altitude error at which quadchute would trigger.

Solution

I am proposing a new solution which uses an "altitude error" criteria to trigger quadchute. This is similar to what was implemented in the past with an important difference. The altitude reference used to compute the altitude error is set to the maximum altitude the vehicle has achieved from the time since it has flown BELOW the current altitude setpoint. Additionally, the altitude reference is constrained not to be larger than the current altitude setpoint (in case the setpoint decreases). We use the value of the TECS reference model as our current altitude setpoint.

This method allows quadchute to only be triggered if the vehicle is actually losing altitude. Quadchute will not trigger if the altitude setpoint is increasing faster than what the vehicle can follow, as long as the vehicle is not descending, no quadchute will be triggered.

Changelog Entry

For release notes:
Refactor uncommanded descend quad-chute to use deterministic altitude error threshold.

Feature/Bugfix XYZ
New parameter: VT_QC_ALT_LOSS
Documentation: Need to clarfiy page ... / done, read docs.px4.io/...

Alternatives

Test coverage

Simulation tests have been done.

Context

Related links, screenshot before/after, video

- use fixed altitude error threshold
- compute error relative to higest altitude the vehicle has achieved
since it has flown below the altitude reference (setpoint)

Signed-off-by: RomanBapst <bapstroman@gmail.com>
@sfuhrer sfuhrer added the Hybrid VTOL 🛩️🚁 Multirotor + Fixedwing! label May 16, 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.

I see no loop whole in the logic, and definitely makes it easier to understand/tune. I have two comments but otherwise good to go and get testing done with it!

Signed-off-by: RomanBapst <bapstroman@gmail.com>
Signed-off-by: RomanBapst <bapstroman@gmail.com>
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.

Good to go in from my side once tested on a real vehicle.

@RomanBapst
Copy link
Contributor Author

@ThomasRigi Do you have some comments on this?

@sfuhrer
Copy link
Contributor

sfuhrer commented May 22, 2023

@ThomasRigi Do you have some comments on this?

@RomanBapst I think he's currently (next months) not around.

@sfuhrer
Copy link
Contributor

sfuhrer commented May 31, 2023

Flight tested:
image

Worked as expected, no false positives and correct trigger eg here when set to 10m error and a de-tuned TECS altitude loop:

https://review.px4.io/plot_app?log=b749c82f-028a-4db5-9294-1592865b25ed

@RomanBapst
Copy link
Contributor Author

@sfuhrer Thanks for testing!

@sfuhrer sfuhrer merged commit d6413a6 into main May 31, 2023
@sfuhrer sfuhrer deleted the quadchute_new_strategy branch May 31, 2023 15:57
sfuhrer pushed a commit that referenced this pull request May 31, 2023
* refactored uncommanded descend quadchute
- use fixed altitude error threshold
- compute error relative to higest altitude the vehicle has achieved
since it has flown below the altitude reference (setpoint)

* disabled altitude loss quadchute by default

* altitude loss quadchute: added protection against invalid local z


---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
harrisondragoon pushed a commit to harrisondragoon/PX4-Autopilot that referenced this pull request May 31, 2023
* refactored uncommanded descend quadchute
- use fixed altitude error threshold
- compute error relative to higest altitude the vehicle has achieved
since it has flown below the altitude reference (setpoint)

* disabled altitude loss quadchute by default

* altitude loss quadchute: added protection against invalid local z


---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
sfuhrer pushed a commit that referenced this pull request Jun 2, 2023
* refactored uncommanded descend quadchute
- use fixed altitude error threshold
- compute error relative to higest altitude the vehicle has achieved
since it has flown below the altitude reference (setpoint)

* disabled altitude loss quadchute by default

* altitude loss quadchute: added protection against invalid local z


---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
RomanBapst added a commit to PX4/PX4-user_guide that referenced this pull request Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hybrid VTOL 🛩️🚁 Multirotor + Fixedwing!
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants