mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 11:29:58 +03:00
Fix: Hyperbolic TPA curve initialization (for wings) (#13932)
This commit is contained in:
parent
331801c7a2
commit
983b510184
5 changed files with 39 additions and 38 deletions
|
@ -321,7 +321,7 @@ float getTpaFactorClassic(float tpaArgument)
|
|||
return 1.0f - tpaRate;
|
||||
}
|
||||
|
||||
void pidUpdateTpaFactor(float throttle, const pidProfile_t *pidProfile)
|
||||
void pidUpdateTpaFactor(float throttle)
|
||||
{
|
||||
// don't permit throttle > 1 & throttle < 0 ? is this needed ? can throttle be > 1 or < 0 at this point
|
||||
throttle = constrainf(throttle, 0.0f, 1.0f);
|
||||
|
@ -334,7 +334,7 @@ void pidUpdateTpaFactor(float throttle, const pidProfile_t *pidProfile)
|
|||
#endif
|
||||
|
||||
#ifdef USE_ADVANCED_TPA
|
||||
switch (pidProfile->tpa_curve_type) {
|
||||
switch (pidRuntime.tpaCurveType) {
|
||||
case TPA_CURVE_HYPERBOLIC:
|
||||
tpaFactor = pwlInterpolate(&pidRuntime.tpaCurvePwl, tpaArgument);
|
||||
break;
|
||||
|
@ -343,7 +343,6 @@ void pidUpdateTpaFactor(float throttle, const pidProfile_t *pidProfile)
|
|||
tpaFactor = getTpaFactorClassic(tpaArgument);
|
||||
}
|
||||
#else
|
||||
UNUSED(pidProfile);
|
||||
tpaFactor = getTpaFactorClassic(tpaArgument);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue