1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00

Add CMS entry for motor_output_limit

Will assist tuning while at the field. Added under PROFILE -> MISC PP.
This commit is contained in:
Bruce Luckcuck 2019-02-02 08:57:37 -05:00 committed by Michael Keller
parent e1b84ad204
commit 9d7af42e9f
3 changed files with 13 additions and 4 deletions

View file

@ -1011,7 +1011,7 @@ const clivalue_t valueTable[] = {
{ "dterm_cut_lowpass_hz", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 1, 20 }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_cut_lowpass_hz) }, { "dterm_cut_lowpass_hz", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 1, 20 }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_cut_lowpass_hz) },
#endif #endif
{ "motor_output_limit", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 1, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, motor_output_limit) }, { "motor_output_limit", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { MOTOR_OUTPUT_LIMIT_PERCENT_MIN, MOTOR_OUTPUT_LIMIT_PERCENT_MAX }, PG_PID_PROFILE, offsetof(pidProfile_t, motor_output_limit) },
#ifdef USE_LAUNCH_CONTROL #ifdef USE_LAUNCH_CONTROL
{ "launch_control_mode", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_LAUNCH_CONTROL_MODE }, PG_PID_PROFILE, offsetof(pidProfile_t, launchControlMode) }, { "launch_control_mode", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_LAUNCH_CONTROL_MODE }, PG_PID_PROFILE, offsetof(pidProfile_t, launchControlMode) },

View file

@ -39,16 +39,19 @@
#include "common/utils.h" #include "common/utils.h"
#include "config/feature.h" #include "config/feature.h"
#include "pg/pg.h"
#include "drivers/pwm_output.h"
#include "fc/config.h" #include "fc/config.h"
#include "fc/core.h"
#include "fc/controlrate_profile.h" #include "fc/controlrate_profile.h"
#include "fc/core.h"
#include "fc/rc_controls.h" #include "fc/rc_controls.h"
#include "fc/runtime_config.h" #include "fc/runtime_config.h"
#include "flight/pid.h" #include "flight/pid.h"
#include "pg/pg.h"
#include "sensors/gyro.h" #include "sensors/gyro.h"
@ -322,6 +325,7 @@ static uint8_t cmsx_horizonTransition;
static uint8_t cmsx_throttleBoost; static uint8_t cmsx_throttleBoost;
static uint16_t cmsx_itermAcceleratorGain; static uint16_t cmsx_itermAcceleratorGain;
static uint16_t cmsx_itermThrottleThreshold; static uint16_t cmsx_itermThrottleThreshold;
static uint8_t cmsx_motorOutputLimit;
static long cmsx_profileOtherOnEnter(void) static long cmsx_profileOtherOnEnter(void)
{ {
@ -339,6 +343,7 @@ static long cmsx_profileOtherOnEnter(void)
cmsx_itermThrottleThreshold = pidProfile->itermThrottleThreshold; cmsx_itermThrottleThreshold = pidProfile->itermThrottleThreshold;
cmsx_throttleBoost = pidProfile->throttle_boost; cmsx_throttleBoost = pidProfile->throttle_boost;
cmsx_motorOutputLimit = pidProfile->motor_output_limit;
return 0; return 0;
} }
@ -359,6 +364,7 @@ static long cmsx_profileOtherOnExit(const OSD_Entry *self)
pidProfile->itermThrottleThreshold = cmsx_itermThrottleThreshold; pidProfile->itermThrottleThreshold = cmsx_itermThrottleThreshold;
pidProfile->throttle_boost = cmsx_throttleBoost; pidProfile->throttle_boost = cmsx_throttleBoost;
pidProfile->motor_output_limit = cmsx_motorOutputLimit;
return 0; return 0;
} }
@ -378,7 +384,7 @@ static OSD_Entry cmsx_menuProfileOtherEntries[] = {
#ifdef USE_LAUNCH_CONTROL #ifdef USE_LAUNCH_CONTROL
{"LAUNCH CONTROL", OME_Submenu, cmsMenuChange, &cmsx_menuLaunchControl, 0 }, {"LAUNCH CONTROL", OME_Submenu, cmsMenuChange, &cmsx_menuLaunchControl, 0 },
#endif #endif
{ "MTR OUT LIM %",OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_motorOutputLimit, MOTOR_OUTPUT_LIMIT_PERCENT_MIN, MOTOR_OUTPUT_LIMIT_PERCENT_MAX, 1}, 0 },
{ "BACK", OME_Back, NULL, NULL, 0 }, { "BACK", OME_Back, NULL, NULL, 0 },
{ NULL, OME_END, NULL, NULL, 0 } { NULL, OME_END, NULL, NULL, 0 }

View file

@ -32,6 +32,9 @@
#define DSHOT_TELEMETRY_INPUT_LEN 32 #define DSHOT_TELEMETRY_INPUT_LEN 32
#define PROSHOT_TELEMETRY_INPUT_LEN 8 #define PROSHOT_TELEMETRY_INPUT_LEN 8
#define MOTOR_OUTPUT_LIMIT_PERCENT_MIN 1
#define MOTOR_OUTPUT_LIMIT_PERCENT_MAX 100
/* /*
DshotSettingRequest (KISS24). Spin direction, 3d and save Settings reqire 10 requests.. and the TLM Byte must always be high if 1-47 are used to send settings DshotSettingRequest (KISS24). Spin direction, 3d and save Settings reqire 10 requests.. and the TLM Byte must always be high if 1-47 are used to send settings