1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Removed VBat PID compensation.

This commit is contained in:
mikeller 2020-03-24 02:54:49 +13:00
parent 97ad043f9e
commit b6689edc26
13 changed files with 7 additions and 27 deletions

View file

@ -827,7 +827,7 @@ static void updateDynLpfCutoffs(timeUs_t currentTimeUs, float throttle)
}
#endif
FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensation)
FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs)
{
// Find min and max throttle based on conditions. Throttle has to be known before mixing
calculateThrottleAndCurrentMotorEndpoints(currentTimeUs);
@ -869,9 +869,6 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
scaledAxisPidYaw = -scaledAxisPidYaw;
}
// Calculate voltage compensation
const float vbatCompensationFactor = vbatPidCompensation ? calculateVbatPidCompensation() : 1.0f;
// Apply the throttle_limit_percent to scale or limit the throttle based on throttle_limit_type
if (currentControlRateProfile->throttle_limit_type != THROTTLE_LIMIT_TYPE_OFF) {
throttle = applyThrottleLimit(throttle);
@ -905,8 +902,6 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
scaledAxisPidPitch * activeMixer[i].pitch +
scaledAxisPidYaw * activeMixer[i].yaw;
mix *= vbatCompensationFactor; // Add voltage compensation
if (mix > motorMixMax) {
motorMixMax = mix;
} else if (mix < motorMixMin) {