Skip to content

Commit

Permalink
Merge pull request betaflight#11721 from KarateBrot/d_lpf
Browse files Browse the repository at this point in the history
Fix debug mode D_LPF
  • Loading branch information
blckmn committed Jul 10, 2022
2 parents ea7807c + 0186a7b commit c9f49ad
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 c9f49ad

Please sign in to comment.