mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 23:35:34 +03:00
make itermrelax on yaw optional
This commit is contained in:
parent
7e12e9da18
commit
6239b8258a
3 changed files with 10 additions and 3 deletions
|
@ -628,7 +628,7 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, const rollAndPitchT
|
||||||
|
|
||||||
// -----calculate I component
|
// -----calculate I component
|
||||||
float itermErrorRate;
|
float itermErrorRate;
|
||||||
if (itermRelax) {
|
if (itermRelax && (axis < FD_YAW || itermRelax == 2 )) {
|
||||||
const float gyroTargetLow = pt1FilterApply(&windupLpf[axis][0], currentPidSetpoint);
|
const float gyroTargetLow = pt1FilterApply(&windupLpf[axis][0], currentPidSetpoint);
|
||||||
const float gyroTargetHigh = pt1FilterApply(&windupLpf[axis][1], currentPidSetpoint);
|
const float gyroTargetHigh = pt1FilterApply(&windupLpf[axis][1], currentPidSetpoint);
|
||||||
if (axis < FD_YAW) {
|
if (axis < FD_YAW) {
|
||||||
|
|
|
@ -344,6 +344,11 @@ static const char * const lookupTableVideoSystem[] = {
|
||||||
};
|
};
|
||||||
#endif // USE_MAX7456
|
#endif // USE_MAX7456
|
||||||
|
|
||||||
|
static const char * const lookupTableItermRelax[] = {
|
||||||
|
"OFF", "RP", "RPY"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#define LOOKUP_TABLE_ENTRY(name) { name, ARRAYLEN(name) }
|
#define LOOKUP_TABLE_ENTRY(name) { name, ARRAYLEN(name) }
|
||||||
|
|
||||||
const lookupTableEntry_t lookupTables[] = {
|
const lookupTableEntry_t lookupTables[] = {
|
||||||
|
@ -418,6 +423,7 @@ const lookupTableEntry_t lookupTables[] = {
|
||||||
#ifdef USE_MAX7456
|
#ifdef USE_MAX7456
|
||||||
LOOKUP_TABLE_ENTRY(lookupTableVideoSystem),
|
LOOKUP_TABLE_ENTRY(lookupTableVideoSystem),
|
||||||
#endif // USE_MAX7456
|
#endif // USE_MAX7456
|
||||||
|
LOOKUP_TABLE_ENTRY(lookupTableItermRelax),
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef LOOKUP_TABLE_ENTRY
|
#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) },
|
{ "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) },
|
{ "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_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_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) },
|
{ "iterm_windup", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 30, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, itermWindupPointPercent) },
|
||||||
|
|
|
@ -97,6 +97,7 @@ typedef enum {
|
||||||
#ifdef USE_MAX7456
|
#ifdef USE_MAX7456
|
||||||
TABLE_VIDEO_SYSTEM,
|
TABLE_VIDEO_SYSTEM,
|
||||||
#endif // USE_MAX7456
|
#endif // USE_MAX7456
|
||||||
|
TABLE_ITERM_RELAX,
|
||||||
LOOKUP_TABLE_COUNT
|
LOOKUP_TABLE_COUNT
|
||||||
} lookupTableIndex_e;
|
} lookupTableIndex_e;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue