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

Fixed Wing: Compensate minimum sink rate based on weight ratio and air density #22049

Closed
wants to merge 2 commits into from

Conversation

RomanBapst
Copy link
Contributor

@RomanBapst RomanBapst commented Sep 6, 2023

Solved Problem

The minimum sink rate (gliding) of a fixed wing is a function of vehicle weight, air density, wing area and the airfoil polars.
While the wing area and the polars are generally constant, the weight and the air density are likely to change.

In PX4 the parameter FW_T_SINK_MIN determines the mapping between commanded sink rate and throttle output. If the commanded sinkrate equals or exceeds FW_T_SINK_MIN then generally TECS will command minimum throttle (since we are gliding or maybe even descending faster).

Since the minimum sink rate changes with weight and air density, it's important to compensate for this, as it affects how well TECS tracks desired energy rate.

For both the vehicle weight and the air density there is a square root relation to sinkrate. This makes compensation based on these two factors straightforward.

$V_{sink} = \sqrt{2mg \over {\rho S}} * f(C_A, C_D)$

where $S$ is the wing area.

Solution

Compensate minimum sink rate based on weight ration and air density.

Changelog Entry

For release notes:

Feature: Compensate TECS minimum sink speed for weight ratio and air density.
Documentation: Need to clarify TECS tuning.

Test coverage

Context

Related links, screenshot before/after, video

@RomanBapst RomanBapst requested a review from tstastny September 6, 2023 11:25
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.

Are you still working on this one? - looks like geMinimumSinkRate() isnt actually called anywhere..

Comment on lines 491 to 494
/**
* @brief Return the maximum climb rate achievable under the current conditions.
* @return Maximum climbrate.
*/
Copy link

Choose a reason for hiding this comment

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

thanks for writing a brief - can you list the conditions that are considered, and can you add units to the @return?

Comment on lines 496 to 500

/**
* @brief Return the minimum sink rate achievable under the current conditions.
* @return Minimum sink rate.
*/
Copy link

Choose a reason for hiding this comment

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

same comment

@tstastny
Copy link

tstastny commented Sep 8, 2023

also you can replace this with your new encapsulated weight ratio method

if (_param_weight_base.get() > FLT_EPSILON && _param_weight_gross.get() > FLT_EPSILON) {
weight_ratio = math::constrain(_param_weight_gross.get() / _param_weight_base.get(), MIN_WEIGHT_RATIO,
MAX_WEIGHT_RATIO);
}

Signed-off-by: RomanBapst <[email protected]>
@RomanBapst
Copy link
Contributor Author

Closing in favor of #22091

@RomanBapst RomanBapst closed this Sep 18, 2023
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.

3 participants