1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Merge pull request #11721 from KarateBrot/d_lpf

Fix debug mode D_LPF
This commit is contained in:
J Blackman 2022-07-10 15:31:46 +10:00 committed by GitHub
commit c9f49ada4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -910,11 +910,11 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, timeUs_t currentTim
// This is done to avoid DTerm spikes that occur with dynamically
// calculated deltaT whenever another task causes the PID
// loop execution to be delayed.
previousRawGyroRateDterm[axis] = gyroRateDterm[axis];
// Log the unfiltered D for ROLL and PITCH
if (axis != FD_YAW) {
const float delta = (previousRawGyroRateDterm[axis] - gyroRateDterm[axis]) * pidRuntime.pidFrequency / D_LPF_RAW_SCALE;
previousRawGyroRateDterm[axis] = gyroRateDterm[axis];
DEBUG_SET(DEBUG_D_LPF, axis, lrintf(delta));
}