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

add debug option DEBUG_ITERM_RELAX

This commit is contained in:
Thorsten Laux 2018-05-24 22:08:13 +02:00
parent 32748a328a
commit 791c584d81
3 changed files with 4 additions and 0 deletions

View file

@ -69,4 +69,5 @@ const char * const debugModeNames[DEBUG_COUNT] = {
"USB",
"SMARTAUDIO",
"RTH",
"ITERM_RELAX"
};

View file

@ -87,6 +87,7 @@ typedef enum {
DEBUG_USB,
DEBUG_SMARTAUDIO,
DEBUG_RTH,
DEBUG_ITERM_RELAX,
DEBUG_COUNT
} debugType_e;

View file

@ -631,6 +631,8 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, const rollAndPitchT
if (itermRelax) {
const float gyroTargetHigh = pt1FilterApply(&windupLpf[axis][0], currentPidSetpoint);
const float gyroTargetLow = pt1FilterApply(&windupLpf[axis][1], currentPidSetpoint);
DEBUG_SET(DEBUG_ITERM_RELAX, 0, gyroTargetHigh);
DEBUG_SET(DEBUG_ITERM_RELAX, 1, gyroTargetLow);
const float gmax = MAX(gyroTargetHigh, gyroTargetLow);
const float gmin = MIN(gyroTargetHigh, gyroTargetLow);
if (gyroRate >= gmin && gyroRate <= gmax)