mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
VBAT PID compensation Initial Implementation // Untested
This commit is contained in:
parent
0e735ae313
commit
f1bb13d364
5 changed files with 17 additions and 2 deletions
|
@ -43,6 +43,7 @@
|
|||
|
||||
#include "sensors/sensors.h"
|
||||
#include "sensors/acceleration.h"
|
||||
#include "sensors/battery.h"
|
||||
|
||||
#include "flight/mixer.h"
|
||||
#include "flight/failsafe.h"
|
||||
|
@ -775,6 +776,8 @@ void mixTable(void)
|
|||
axisPID[ROLL] * currentMixer[i].roll +
|
||||
-mixerConfig->yaw_motor_direction * axisPID[YAW] * currentMixer[i].yaw;
|
||||
|
||||
if (batteryConfig->vbatPidCompensation) rollPitchYawMix[i] *= calculateVbatPidCompensation(); // Add voltage PID 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