From df4b893d61a859bf0cd9a35913000329e43ba131 Mon Sep 17 00:00:00 2001 From: Miguel Angel Mulero Martinez Date: Tue, 31 Jul 2018 09:18:06 +0200 Subject: [PATCH 1/2] Add Throttle Boost to CMS --- src/main/cms/cms_menu_imu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/cms/cms_menu_imu.c b/src/main/cms/cms_menu_imu.c index f291932dd..ecf82c994 100644 --- a/src/main/cms/cms_menu_imu.c +++ b/src/main/cms/cms_menu_imu.c @@ -247,6 +247,7 @@ static uint8_t cmsx_feedForwardTransition; static uint8_t cmsx_angleStrength; static uint8_t cmsx_horizonStrength; static uint8_t cmsx_horizonTransition; +static uint8_t cmsx_throttleBoost; static uint16_t cmsx_itermAcceleratorGain; static uint16_t cmsx_itermThrottleThreshold; @@ -265,6 +266,8 @@ static long cmsx_profileOtherOnEnter(void) cmsx_itermAcceleratorGain = pidProfile->itermAcceleratorGain; cmsx_itermThrottleThreshold = pidProfile->itermThrottleThreshold; + cmsx_throttleBoost = pidProfile->throttle_boost; + return 0; } @@ -283,6 +286,8 @@ static long cmsx_profileOtherOnExit(const OSD_Entry *self) pidProfile->itermAcceleratorGain = cmsx_itermAcceleratorGain; pidProfile->itermThrottleThreshold = cmsx_itermThrottleThreshold; + pidProfile->throttle_boost = cmsx_throttleBoost; + return 0; } @@ -295,6 +300,7 @@ static OSD_Entry cmsx_menuProfileOtherEntries[] = { { "HORZN TRS", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonTransition, 0, 200, 1 } , 0 }, { "AG GAIN", OME_UINT16, NULL, &(OSD_UINT16_t) { &cmsx_itermAcceleratorGain, 1000, 30000, 10 } , 0 }, { "AG THR", OME_UINT16, NULL, &(OSD_UINT16_t) { &cmsx_itermThrottleThreshold, 20, 1000, 1 } , 0 }, + { "THR BOOST", OME_UINT16, NULL, &(OSD_UINT8_t) { &cmsx_throttleBoost, 0, 100, 1 } , 0 }, { "BACK", OME_Back, NULL, NULL, 0 }, { NULL, OME_END, NULL, NULL, 0 } From e0d17a5e2f0eda9a371e3323e7f7bf06ec7d51d4 Mon Sep 17 00:00:00 2001 From: Miguel Angel Mulero Martinez Date: Tue, 31 Jul 2018 10:15:25 +0200 Subject: [PATCH 2/2] Hide LPF2 and Throttle Boost from CMS if not available --- src/main/cms/cms_menu_imu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/cms/cms_menu_imu.c b/src/main/cms/cms_menu_imu.c index ecf82c994..b2c87355c 100644 --- a/src/main/cms/cms_menu_imu.c +++ b/src/main/cms/cms_menu_imu.c @@ -300,7 +300,9 @@ static OSD_Entry cmsx_menuProfileOtherEntries[] = { { "HORZN TRS", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_horizonTransition, 0, 200, 1 } , 0 }, { "AG GAIN", OME_UINT16, NULL, &(OSD_UINT16_t) { &cmsx_itermAcceleratorGain, 1000, 30000, 10 } , 0 }, { "AG THR", OME_UINT16, NULL, &(OSD_UINT16_t) { &cmsx_itermThrottleThreshold, 20, 1000, 1 } , 0 }, +#ifdef USE_THROTTLE_BOOST { "THR BOOST", OME_UINT16, NULL, &(OSD_UINT8_t) { &cmsx_throttleBoost, 0, 100, 1 } , 0 }, +#endif { "BACK", OME_Back, NULL, NULL, 0 }, { NULL, OME_END, NULL, NULL, 0 } @@ -355,7 +357,9 @@ static OSD_Entry cmsx_menuFilterGlobalEntries[] = { "-- FILTER GLB --", OME_Label, NULL, NULL, 0 }, { "GYRO LPF", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_lowpass_hz, 0, 16000, 1 }, 0 }, +#ifdef USE_GYRO_LPF2 { "GYRO LPF2", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_lowpass2_hz, 0, 16000, 1 }, 0 }, +#endif { "GYRO NF1", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_soft_notch_hz_1, 0, 500, 1 }, 0 }, { "GYRO NF1C", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_soft_notch_cutoff_1, 0, 500, 1 }, 0 }, { "GYRO NF2", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_soft_notch_hz_2, 0, 500, 1 }, 0 },