Skip to content

Commit

Permalink
Fix debug mode D_LPF
Browse files Browse the repository at this point in the history
  • Loading branch information
KarateBrot committed Jul 9, 2022
1 parent ea7807c commit 0186a7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/flight/pid.c
Expand Up @@ -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));
}

Expand Down

0 comments on commit 0186a7b

Please sign in to comment.