From bef46dd120e1a286079bf5d6ca72f3f5edd69449 Mon Sep 17 00:00:00 2001 From: borisbstyle Date: Wed, 27 Apr 2016 22:15:39 +0200 Subject: [PATCH] TPA added for Yaw // Cleanup unused config params --- src/main/blackbox/blackbox.c | 4 ---- src/main/config/config.c | 1 - src/main/flight/pid.h | 3 --- src/main/io/serial_cli.c | 7 ------- src/main/mw.c | 9 ++------- 5 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/main/blackbox/blackbox.c b/src/main/blackbox/blackbox.c index b0413f6bfc..0190affa1b 100644 --- a/src/main/blackbox/blackbox.c +++ b/src/main/blackbox/blackbox.c @@ -1295,10 +1295,6 @@ static bool blackboxWriteSysinfo() blackboxPrintfHeaderLine("dterm_lpf_hz:%d", (int)(masterConfig.profile[masterConfig.current_profile_index].pidProfile.dterm_lpf_hz * 100.0)); break; - case 40: - blackboxPrintfHeaderLine("deltaMethod:%d", - masterConfig.profile[masterConfig.current_profile_index].pidProfile.deltaMethod); - break; case 41: blackboxPrintfHeaderLine("H_sensitivity:%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.H_sensitivity); diff --git a/src/main/config/config.c b/src/main/config/config.c index 822e95515f..bb91db4d29 100755 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -183,7 +183,6 @@ static void resetPidProfile(pidProfile_t *pidProfile) pidProfile->rollPitchItermResetAlways = 0; pidProfile->yawItermResetRate = 50; 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 diff --git a/src/main/flight/pid.h b/src/main/flight/pid.h index 8920d0b820..94addfb55d 100644 --- a/src/main/flight/pid.h +++ b/src/main/flight/pid.h @@ -23,8 +23,6 @@ #define YAW_P_LIMIT_MAX 400 // Maximum value for yaw P limiter #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_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 uint8_t rollPitchItermResetAlways; // Reset Iterm also without SUPER EXPO uint16_t yawItermResetRate; // Experimental threshold for resetting iterm for yaw on certain rates - uint8_t deltaMethod; // Alternative delta Calculation uint16_t yaw_p_limit; uint8_t dterm_average_count; // Configurable delta count for dterm uint8_t dterm_differentiator; diff --git a/src/main/io/serial_cli.c b/src/main/io/serial_cli.c index a218243f30..2f837ed9ef 100644 --- a/src/main/io/serial_cli.c +++ b/src/main/io/serial_cli.c @@ -426,10 +426,6 @@ static const char * const lookupTableMagHardware[] = { "AK8963" }; -static const char * const lookupDeltaMethod[] = { - "ERROR", "MEASUREMENT" -}; - static const char * const lookupTableDebug[] = { "NONE", "CYCLETIME", @@ -468,7 +464,6 @@ typedef enum { TABLE_ACC_HARDWARE, TABLE_BARO_HARDWARE, TABLE_MAG_HARDWARE, - TABLE_DELTA_METHOD, TABLE_DEBUG, TABLE_SUPEREXPO_YAW, } lookupTableIndex_e; @@ -492,7 +487,6 @@ static const lookupTableEntry_t lookupTables[] = { { lookupTableAccHardware, sizeof(lookupTableAccHardware) / sizeof(char *) }, { lookupTableBaroHardware, sizeof(lookupTableBaroHardware) / sizeof(char *) }, { lookupTableMagHardware, sizeof(lookupTableMagHardware) / sizeof(char *) }, - { lookupDeltaMethod, sizeof(lookupDeltaMethod) / sizeof(char *) }, { lookupTableDebug, sizeof(lookupTableDebug) / 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_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_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 } }, diff --git a/src/main/mw.c b/src/main/mw.c index 7f7497f6bc..a7b184758e 100644 --- a/src/main/mw.c +++ b/src/main/mw.c @@ -261,13 +261,8 @@ void annexCode(void) 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 - if (axis == YAW) { - PIDweight[axis] = 100; - } - else { - PIDweight[axis] = prop; - } + // non coupled PID reduction scaler used in PID controller 1 and PID controller 2. + PIDweight[axis] = prop; if (rcData[axis] < masterConfig.rxConfig.midrc) rcCommand[axis] = -rcCommand[axis];