1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

TPA added for Yaw // Cleanup unused config params

This commit is contained in:
borisbstyle 2016-04-27 22:15:39 +02:00
parent 86c2e12c07
commit bef46dd120
5 changed files with 2 additions and 22 deletions

View file

@ -1295,10 +1295,6 @@ static bool blackboxWriteSysinfo()
blackboxPrintfHeaderLine("dterm_lpf_hz:%d", blackboxPrintfHeaderLine("dterm_lpf_hz:%d",
(int)(masterConfig.profile[masterConfig.current_profile_index].pidProfile.dterm_lpf_hz * 100.0)); (int)(masterConfig.profile[masterConfig.current_profile_index].pidProfile.dterm_lpf_hz * 100.0));
break; break;
case 40:
blackboxPrintfHeaderLine("deltaMethod:%d",
masterConfig.profile[masterConfig.current_profile_index].pidProfile.deltaMethod);
break;
case 41: case 41:
blackboxPrintfHeaderLine("H_sensitivity:%d", blackboxPrintfHeaderLine("H_sensitivity:%d",
masterConfig.profile[masterConfig.current_profile_index].pidProfile.H_sensitivity); masterConfig.profile[masterConfig.current_profile_index].pidProfile.H_sensitivity);

View file

@ -183,7 +183,6 @@ static void resetPidProfile(pidProfile_t *pidProfile)
pidProfile->rollPitchItermResetAlways = 0; pidProfile->rollPitchItermResetAlways = 0;
pidProfile->yawItermResetRate = 50; pidProfile->yawItermResetRate = 50;
pidProfile->dterm_lpf_hz = 70.0f; // filtering ON by default pidProfile->dterm_lpf_hz = 70.0f; // filtering ON by default
pidProfile->deltaMethod = DELTA_FROM_MEASUREMENT;
pidProfile->H_sensitivity = 75; // TODO - Cleanup during next EEPROM changes pidProfile->H_sensitivity = 75; // TODO - Cleanup during next EEPROM changes

View file

@ -23,8 +23,6 @@
#define YAW_P_LIMIT_MAX 400 // Maximum value for yaw P limiter #define YAW_P_LIMIT_MAX 400 // Maximum value for yaw P limiter
#define PID_LAST_RATE_COUNT 7 #define PID_LAST_RATE_COUNT 7
#define PID_DTERM_FIR_MAX_LENGTH 7
#define PID_MAX_DIFFERENTIATOR (PID_DTERM_FIR_MAX_LENGTH-2)
#define ITERM_RESET_THRESHOLD 20 #define ITERM_RESET_THRESHOLD 20
#define ITERM_RESET_THRESHOLD_YAW 10 #define ITERM_RESET_THRESHOLD_YAW 10
@ -81,7 +79,6 @@ typedef struct pidProfile_s {
uint16_t rollPitchItermResetRate; // Experimental threshold for resetting iterm for pitch and roll on certain rates uint16_t rollPitchItermResetRate; // Experimental threshold for resetting iterm for pitch and roll on certain rates
uint8_t rollPitchItermResetAlways; // Reset Iterm also without SUPER EXPO uint8_t rollPitchItermResetAlways; // Reset Iterm also without SUPER EXPO
uint16_t yawItermResetRate; // Experimental threshold for resetting iterm for yaw on certain rates uint16_t yawItermResetRate; // Experimental threshold for resetting iterm for yaw on certain rates
uint8_t deltaMethod; // Alternative delta Calculation
uint16_t yaw_p_limit; uint16_t yaw_p_limit;
uint8_t dterm_average_count; // Configurable delta count for dterm uint8_t dterm_average_count; // Configurable delta count for dterm
uint8_t dterm_differentiator; uint8_t dterm_differentiator;

View file

@ -426,10 +426,6 @@ static const char * const lookupTableMagHardware[] = {
"AK8963" "AK8963"
}; };
static const char * const lookupDeltaMethod[] = {
"ERROR", "MEASUREMENT"
};
static const char * const lookupTableDebug[] = { static const char * const lookupTableDebug[] = {
"NONE", "NONE",
"CYCLETIME", "CYCLETIME",
@ -468,7 +464,6 @@ typedef enum {
TABLE_ACC_HARDWARE, TABLE_ACC_HARDWARE,
TABLE_BARO_HARDWARE, TABLE_BARO_HARDWARE,
TABLE_MAG_HARDWARE, TABLE_MAG_HARDWARE,
TABLE_DELTA_METHOD,
TABLE_DEBUG, TABLE_DEBUG,
TABLE_SUPEREXPO_YAW, TABLE_SUPEREXPO_YAW,
} lookupTableIndex_e; } lookupTableIndex_e;
@ -492,7 +487,6 @@ static const lookupTableEntry_t lookupTables[] = {
{ lookupTableAccHardware, sizeof(lookupTableAccHardware) / sizeof(char *) }, { lookupTableAccHardware, sizeof(lookupTableAccHardware) / sizeof(char *) },
{ lookupTableBaroHardware, sizeof(lookupTableBaroHardware) / sizeof(char *) }, { lookupTableBaroHardware, sizeof(lookupTableBaroHardware) / sizeof(char *) },
{ lookupTableMagHardware, sizeof(lookupTableMagHardware) / sizeof(char *) }, { lookupTableMagHardware, sizeof(lookupTableMagHardware) / sizeof(char *) },
{ lookupDeltaMethod, sizeof(lookupDeltaMethod) / sizeof(char *) },
{ lookupTableDebug, sizeof(lookupTableDebug) / sizeof(char *) }, { lookupTableDebug, sizeof(lookupTableDebug) / sizeof(char *) },
{ lookupTableSuperExpoYaw, sizeof(lookupTableSuperExpoYaw) / sizeof(char *) } { lookupTableSuperExpoYaw, sizeof(lookupTableSuperExpoYaw) / sizeof(char *) }
}; };
@ -727,7 +721,6 @@ const clivalue_t valueTable[] = {
{ "mag_hardware", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.mag_hardware, .config.lookup = { TABLE_MAG_HARDWARE } }, { "mag_hardware", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.mag_hardware, .config.lookup = { TABLE_MAG_HARDWARE } },
{ "mag_declination", VAR_INT16 | MASTER_VALUE, &masterConfig.mag_declination, .config.minmax = { -18000, 18000 } }, { "mag_declination", VAR_INT16 | MASTER_VALUE, &masterConfig.mag_declination, .config.minmax = { -18000, 18000 } },
{ "pid_delta_method", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, &masterConfig.profile[0].pidProfile.deltaMethod, .config.lookup = { TABLE_DELTA_METHOD } },
{ "dterm_lowpass_hz", VAR_FLOAT | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.dterm_lpf_hz, .config.minmax = {0, 500 } }, { "dterm_lowpass_hz", VAR_FLOAT | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.dterm_lpf_hz, .config.minmax = {0, 500 } },
{ "dterm_differentiator", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, &masterConfig.profile[0].pidProfile.dterm_differentiator, .config.lookup = { TABLE_OFF_ON } }, { "dterm_differentiator", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, &masterConfig.profile[0].pidProfile.dterm_differentiator, .config.lookup = { TABLE_OFF_ON } },
{ "iterm_always_reset", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.rollPitchItermResetAlways, .config.lookup = { TABLE_OFF_ON } }, { "iterm_always_reset", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.rollPitchItermResetAlways, .config.lookup = { TABLE_OFF_ON } },

View file

@ -261,13 +261,8 @@ void annexCode(void)
rcCommand[axis] = (lookupYawRC[tmp2] + (tmp - tmp2 * 100) * (lookupYawRC[tmp2 + 1] - lookupYawRC[tmp2]) / 100) * -masterConfig.yaw_control_direction; rcCommand[axis] = (lookupYawRC[tmp2] + (tmp - tmp2 * 100) * (lookupYawRC[tmp2 + 1] - lookupYawRC[tmp2]) / 100) * -masterConfig.yaw_control_direction;
} }
// non coupled PID reduction scaler used in PID controller 1 and PID controller 2. YAW TPA disabled. 100 means 100% of the pids // non coupled PID reduction scaler used in PID controller 1 and PID controller 2.
if (axis == YAW) { PIDweight[axis] = prop;
PIDweight[axis] = 100;
}
else {
PIDweight[axis] = prop;
}
if (rcData[axis] < masterConfig.rxConfig.midrc) if (rcData[axis] < masterConfig.rxConfig.midrc)
rcCommand[axis] = -rcCommand[axis]; rcCommand[axis] = -rcCommand[axis];