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

make itermrelax on yaw optional

This commit is contained in:
Thorsten Laux 2018-05-28 16:34:25 +02:00
parent 7e12e9da18
commit 6239b8258a
3 changed files with 10 additions and 3 deletions

View file

@ -628,7 +628,7 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, const rollAndPitchT
// -----calculate I component
float itermErrorRate;
if (itermRelax) {
if (itermRelax && (axis < FD_YAW || itermRelax == 2 )) {
const float gyroTargetLow = pt1FilterApply(&windupLpf[axis][0], currentPidSetpoint);
const float gyroTargetHigh = pt1FilterApply(&windupLpf[axis][1], currentPidSetpoint);
if (axis < FD_YAW) {

View file

@ -344,6 +344,11 @@ static const char * const lookupTableVideoSystem[] = {
};
#endif // USE_MAX7456
static const char * const lookupTableItermRelax[] = {
"OFF", "RP", "RPY"
};
#define LOOKUP_TABLE_ENTRY(name) { name, ARRAYLEN(name) }
const lookupTableEntry_t lookupTables[] = {
@ -418,6 +423,7 @@ const lookupTableEntry_t lookupTables[] = {
#ifdef USE_MAX7456
LOOKUP_TABLE_ENTRY(lookupTableVideoSystem),
#endif // USE_MAX7456
LOOKUP_TABLE_ENTRY(lookupTableItermRelax),
};
#undef LOOKUP_TABLE_ENTRY
@ -757,7 +763,7 @@ const clivalue_t valueTable[] = {
{ "iterm_rotation", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_PID_PROFILE, offsetof(pidProfile_t, iterm_rotation) },
{ "smart_feedforward", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_PID_PROFILE, offsetof(pidProfile_t, smart_feedforward) },
{ "iterm_relax", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_PID_PROFILE, offsetof(pidProfile_t, iterm_relax) },
{ "iterm_relax", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_ITERM_RELAX }, PG_PID_PROFILE, offsetof(pidProfile_t, iterm_relax) },
{ "iterm_relax_cutoff_low", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 1, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, iterm_relax_cutoff_low) },
{ "iterm_relax_cutoff_high", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 1, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, iterm_relax_cutoff_high) },
{ "iterm_windup", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 30, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, itermWindupPointPercent) },

View file

@ -97,6 +97,7 @@ typedef enum {
#ifdef USE_MAX7456
TABLE_VIDEO_SYSTEM,
#endif // USE_MAX7456
TABLE_ITERM_RELAX,
LOOKUP_TABLE_COUNT
} lookupTableIndex_e;