From 0186a7b88d67e94d62594b6bbf8c022f21912fc2 Mon Sep 17 00:00:00 2001 From: KarateBrot Date: Sat, 9 Jul 2022 03:59:16 +0200 Subject: [PATCH] Fix debug mode D_LPF --- src/main/flight/pid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index 455c7722af..b6a3c5baca 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -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)); }