1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-22 07:45:29 +03:00

More Jitter Enhancements for Naze target

remove debug

Anti Jitter Enhancements for Naze target

Jitter Optimalisation without emf avoidance
This commit is contained in:
borisbstyle 2015-09-23 11:59:51 +02:00
parent 9ed1c46065
commit 4a492c611a
3 changed files with 64 additions and 21 deletions

View file

@ -20,6 +20,7 @@
#include <stdint.h>
#include <math.h>
#include "debug.h"
#include "platform.h"
#include "common/maths.h"
@ -88,6 +89,8 @@ enum {
ALIGN_MAG = 2
};
//#define DEBUG_JITTER 3
/* VBAT monitoring interval (in microseconds) - 1s*/
#define VBATINTERVAL (6 * 3500)
/* IBat monitoring interval (in microseconds) - 6 default looptimes */
@ -776,12 +779,23 @@ void loop(void)
loopTime = currentTime + targetLooptime;
imuUpdate(&currentProfile->accelerometerTrims);
// Measure loop rate just after reading the sensors
currentTime = micros();
cycleTime = (int32_t)(currentTime - previousTime);
previousTime = currentTime;
#ifdef DEBUG_JITTER
static uint32_t previousCycleTime;
if (previousCycleTime > cycleTime) {
debug[DEBUG_JITTER] = previousCycleTime - cycleTime;
} else {
debug[DEBUG_JITTER] = cycleTime - previousCycleTime;
}
previousCycleTime = cycleTime;
#endif
dT = (float)targetLooptime * 0.000001f;
filterApply7TapFIR(gyroADC);