mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 13:25:30 +03:00
Revert "Merge pull request #372 from aughey/betaflight"
This reverts commita6a5f50ffb
, reversing changes made to9cc5503851
.
This commit is contained in:
parent
a6a5f50ffb
commit
5ffb3b5068
6 changed files with 30 additions and 58 deletions
|
@ -753,11 +753,6 @@ void mixTable(void)
|
|||
uint32_t i;
|
||||
fix12_t vbatCompensationFactor;
|
||||
static fix12_t mixReduction;
|
||||
bool use_vbat_compensation = false;
|
||||
if (batteryConfig && batteryConfig->vbatPidCompensation) {
|
||||
use_vbat_compensation = true;
|
||||
vbatCompensationFactor = calculateVbatPidCompensation();
|
||||
}
|
||||
|
||||
bool isFailsafeActive = failsafeIsActive(); // TODO - Find out if failsafe checks are really needed here in mixer code
|
||||
|
||||
|
@ -771,6 +766,8 @@ void mixTable(void)
|
|||
int16_t rollPitchYawMixMax = 0; // assumption: symetrical about zero.
|
||||
int16_t rollPitchYawMixMin = 0;
|
||||
|
||||
if (batteryConfig->vbatPidCompensation) vbatCompensationFactor = calculateVbatPidCompensation(); // Calculate voltage compensation
|
||||
|
||||
// Find roll/pitch/yaw desired output
|
||||
for (i = 0; i < motorCount; i++) {
|
||||
rollPitchYawMix[i] =
|
||||
|
@ -778,7 +775,7 @@ void mixTable(void)
|
|||
axisPID[ROLL] * currentMixer[i].roll +
|
||||
-mixerConfig->yaw_motor_direction * axisPID[YAW] * currentMixer[i].yaw;
|
||||
|
||||
if (use_vbat_compensation) rollPitchYawMix[i] = qMultiply(vbatCompensationFactor, rollPitchYawMix[i]); // Add voltage compensation
|
||||
if (batteryConfig->vbatPidCompensation) rollPitchYawMix[i] = qMultiply(vbatCompensationFactor, rollPitchYawMix[i]); // Add voltage compensation
|
||||
|
||||
if (rollPitchYawMix[i] > rollPitchYawMixMax) rollPitchYawMixMax = rollPitchYawMix[i];
|
||||
if (rollPitchYawMix[i] < rollPitchYawMixMin) rollPitchYawMixMin = rollPitchYawMix[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue