mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 01:05:21 +03:00
Antigravity debug
This commit is contained in:
parent
8d6bbe55c6
commit
9566d53452
3 changed files with 6 additions and 2 deletions
|
@ -70,5 +70,6 @@ typedef enum {
|
|||
DEBUG_GENERIC,
|
||||
DEBUG_ITERM_RELAX,
|
||||
DEBUG_D_BOOST,
|
||||
DEBUG_ANTIGRAVITY,
|
||||
DEBUG_COUNT
|
||||
} debugType_e;
|
||||
|
|
|
@ -77,7 +77,8 @@ tables:
|
|||
- name: debug_modes
|
||||
values: ["NONE", "GYRO", "NOTCH", "NAV_LANDING", "FW_ALTITUDE", "AGL", "FLOW_RAW",
|
||||
"FLOW", "SBUS", "FPORT", "ALWAYS", "STAGE2", "SAG_COMP_VOLTAGE",
|
||||
"VIBE", "CRUISE", "REM_FLIGHT_TIME", "SMARTAUDIO", "ACC", "GENERIC", "ITERM_RELAX", "D_BOOST"]
|
||||
"VIBE", "CRUISE", "REM_FLIGHT_TIME", "SMARTAUDIO", "ACC", "GENERIC", "ITERM_RELAX",
|
||||
"D_BOOST", "ANTIGRAVITY"]
|
||||
- name: async_mode
|
||||
values: ["NONE", "GYRO", "ALL"]
|
||||
- name: aux_operator
|
||||
|
|
|
@ -738,7 +738,9 @@ static void FAST_CODE pidApplyMulticopterRateController(pidState_t *pidState, fl
|
|||
applyItermRelax(axis, pidState->gyroRate, pidState->rateTarget, &itermErrorRate);
|
||||
|
||||
#ifdef USE_ANTIGRAVITY
|
||||
itermErrorRate *= scaleRangef(fabsf(antigravityThrottleHpf), 0.0f, 1000.0f, 1.0f, antigravityGain);
|
||||
const float iTermAntigravityGain = scaleRangef(fabsf(antigravityThrottleHpf), 0.0f, 1000.0f, 1.0f, antigravityGain);
|
||||
DEBUG_SET(DEBUG_ANTIGRAVITY, 0, iTermAntigravityGain * 100);
|
||||
itermErrorRate *= iTermAntigravityGain;
|
||||
#endif
|
||||
|
||||
pidState->errorGyroIf += (itermErrorRate * pidState->kI * antiWindupScaler * dT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue