1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

The PID I value uses for AFCS pitch channel

This commit is contained in:
demvlad 2025-04-24 10:49:40 +03:00
parent cb401d1ed9
commit 84431502b4
3 changed files with 42 additions and 29 deletions

View file

@ -1269,6 +1269,16 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, timeUs_t currentTim
if (isAFCS) {
afcsUpdate(pidProfile);
return; // The airplanes FCS do not need PID controller
} else if (pidRuntime.isReadyAFCS) { // Clear the all PID values after AFCS work
for (int axis = FD_ROLL; axis <= FD_YAW; ++axis) {
pidData[axis].P = 0;
pidData[axis].I = 0;
pidData[axis].D = 0;
pidData[axis].F = 0;
pidData[axis].S = 0;
pidData[axis].Sum = 0;
}
pidRuntime.isReadyAFCS = false;
}
#endif