mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
Merge pull request #9633 from mikeller/remove_vbat_pid_compensation
Remove vbat pid compensation
This commit is contained in:
commit
41fa8754bc
13 changed files with 7 additions and 27 deletions
|
@ -825,7 +825,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);
|
||||
|
@ -867,9 +867,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);
|
||||
|
@ -903,8 +900,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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue