mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
Make TPA configurable to affect P/D or D only
Adds a new `tpa_mode` parameter that accepts `PD` (default) and `D`. Allows the user to configer to affect P/D as it always has, or switch to D-only mode. Note: the `tpa_mode` parameter was added to the PID Profile instead of rate profiles with the other TPA parameters. This can be discussed, but I didn't think it made sense to have this be part of rate profiles as it affects PID tuning (the same argument could be made for the other TPA parameters). Code is wrapped in `USE_TPA_MODE` so it can be disabled if needed.
This commit is contained in:
parent
49e2c4d312
commit
fc189e5850
5 changed files with 39 additions and 1 deletions
|
@ -407,6 +407,12 @@ static const char * const lookupTableLaunchControlMode[] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifdef USE_TPA_MODE
|
||||
static const char * const lookupTableTpaMode[] = {
|
||||
"PD", "D"
|
||||
};
|
||||
#endif
|
||||
|
||||
#define LOOKUP_TABLE_ENTRY(name) { name, ARRAYLEN(name) }
|
||||
|
||||
const lookupTableEntry_t lookupTables[] = {
|
||||
|
@ -510,6 +516,9 @@ const lookupTableEntry_t lookupTables[] = {
|
|||
#ifdef USE_LAUNCH_CONTROL
|
||||
LOOKUP_TABLE_ENTRY(lookupTableLaunchControlMode),
|
||||
#endif
|
||||
#ifdef USE_TPA_MODE
|
||||
LOOKUP_TABLE_ENTRY(lookupTableTpaMode),
|
||||
#endif
|
||||
};
|
||||
|
||||
#undef LOOKUP_TABLE_ENTRY
|
||||
|
@ -929,6 +938,10 @@ const clivalue_t valueTable[] = {
|
|||
{ "launch_control_gain", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 0, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, launchControlGain) },
|
||||
#endif
|
||||
|
||||
#ifdef USE_TPA_MODE
|
||||
{ "tpa_mode", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_TPA_MODE }, PG_PID_PROFILE, offsetof(pidProfile_t, tpaMode) },
|
||||
#endif
|
||||
|
||||
// PG_TELEMETRY_CONFIG
|
||||
#ifdef USE_TELEMETRY
|
||||
{ "tlm_inverted", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_TELEMETRY_CONFIG, offsetof(telemetryConfig_t, telemetry_inverted) },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue