Skip to content

Commit bd17812

Browse files
Quick-FlashnerdCopter
authored andcommitted
allow negative ff-boost
High ff brings overshoot and undesirable feel. This allows ff boost to be negative which might allow for even more accurate stick tracking and less overshoot, needs testing. Perhaps normal ff should also be allowed to be negative with positive boost. At that point boost and FF would need to be seperated.
1 parent e86e758 commit bd17812

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/main/cli/settings.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ const lookupTableEntry_t lookupTables[] = {
660660
const clivalue_t valueTable[] = {
661661
// PG_GYRO_CONFIG
662662
{ PARAM_NAME_GYRO_HARDWARE_LPF, VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_GYRO_HARDWARE_LPF }, PG_GYRO_CONFIG, offsetof(gyroConfig_t, gyro_hardware_lpf) },
663-
663+
664664
#if defined(USE_GYRO_SPI_ICM20649)
665665
{ "gyro_high_range", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_GYRO_CONFIG, offsetof(gyroConfig_t, gyro_high_fsr) },
666666
#endif
@@ -1184,10 +1184,10 @@ const clivalue_t valueTable[] = {
11841184
#ifdef USE_FEEDFORWARD
11851185
{ PARAM_NAME_FEEDFORWARD_TRANSITION, VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, feedforward_transition) },
11861186
{ PARAM_NAME_FEEDFORWARD_AVERAGING, VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_FEEDFORWARD_AVERAGING }, PG_PID_PROFILE, offsetof(pidProfile_t, feedforward_averaging) },
1187-
{ PARAM_NAME_FEEDFORWARD_SMOOTH_FACTOR, VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = {0, 75}, PG_PID_PROFILE, offsetof(pidProfile_t, feedforward_smooth_factor) },
1188-
{ PARAM_NAME_FEEDFORWARD_JITTER_FACTOR, VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = {0, 20}, PG_PID_PROFILE, offsetof(pidProfile_t, feedforward_jitter_factor) },
1189-
{ PARAM_NAME_FEEDFORWARD_BOOST, VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 50 }, PG_PID_PROFILE, offsetof(pidProfile_t, feedforward_boost) },
1190-
{ PARAM_NAME_FEEDFORWARD_MAX_RATE_LIMIT, VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = {0, 150}, PG_PID_PROFILE, offsetof(pidProfile_t, feedforward_max_rate_limit) },
1187+
{ PARAM_NAME_FEEDFORWARD_SMOOTH_FACTOR, VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 75 }, PG_PID_PROFILE, offsetof(pidProfile_t, feedforward_smooth_factor) },
1188+
{ PARAM_NAME_FEEDFORWARD_JITTER_FACTOR, VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 20 }, PG_PID_PROFILE, offsetof(pidProfile_t, feedforward_jitter_factor) },
1189+
{ PARAM_NAME_FEEDFORWARD_BOOST, VAR_INT8 | PROFILE_VALUE, .config.minmaxUnsigned = { -50, 50 }, PG_PID_PROFILE, offsetof(pidProfile_t, feedforward_boost) },
1190+
{ PARAM_NAME_FEEDFORWARD_MAX_RATE_LIMIT, VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 150 }, PG_PID_PROFILE, offsetof(pidProfile_t, feedforward_max_rate_limit) },
11911191
#endif
11921192

11931193
#ifdef USE_DYN_IDLE

src/main/cms/cms_menu_imu.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ static uint8_t cmsx_iterm_relax_cutoff;
524524

525525
#ifdef USE_FEEDFORWARD
526526
static uint8_t cmsx_feedforward_transition;
527-
static uint8_t cmsx_feedforward_boost;
527+
static int8_t cmsx_feedforward_boost;
528528
static uint8_t cmsx_feedforward_averaging;
529529
static uint8_t cmsx_feedforward_smooth_factor;
530530
static uint8_t cmsx_feedforward_jitter_factor;
@@ -637,7 +637,7 @@ static const OSD_Entry cmsx_menuProfileOtherEntries[] = {
637637
{ "FF AVERAGING", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_feedforward_averaging, 4, lookupTableFeedforwardAveraging} },
638638
{ "FF SMOOTHNESS", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_feedforward_smooth_factor, 0, 75, 1 } },
639639
{ "FF JITTER", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_feedforward_jitter_factor, 0, 20, 1 } },
640-
{ "FF BOOST", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_feedforward_boost, 0, 50, 1 } },
640+
{ "FF BOOST", OME_UINT8, NULL, &(OSD_INT8_t) { &cmsx_feedforward_boost, -50, 50, 1 } },
641641
#endif
642642
{ "ANGLE STR", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_angleStrength, 0, 200, 1 } },
643643
{ "HORZN STR", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonStrength, 0, 200, 1 } },

src/main/flight/pid.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ typedef struct pidProfile_s {
208208
uint8_t feedforward_averaging; // Number of packets to average when averaging is on
209209
uint8_t feedforward_smooth_factor; // Amount of lowpass type smoothing for feedforward steps
210210
uint8_t feedforward_jitter_factor; // Number of RC steps below which to attenuate feedforward
211-
uint8_t feedforward_boost; // amount of setpoint acceleration to add to feedforward, 10 means 100% added
211+
int8_t feedforward_boost; // setpoint acceleration added to feedforward, 10 means 100% added, higher is more than that
212212
uint8_t feedforward_max_rate_limit; // Maximum setpoint rate percentage for feedforward
213213

214214
uint8_t dterm_lpf1_dyn_expo; // set the curve for dynamic dterm lowpass filter

0 commit comments

Comments
 (0)