1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

Merge branch 'master' into development

This commit is contained in:
borisbstyle 2016-08-09 23:42:18 +02:00
commit d45fcdd9ae
6 changed files with 51 additions and 66 deletions

View file

@ -2,51 +2,51 @@ env:
# - RUNTESTS=True # - RUNTESTS=True
# - PUBLISHMETA=True # - PUBLISHMETA=True
# - PUBLISHDOCS=True # - PUBLISHDOCS=True
- TARGET=AFROMINI # - TARGET=AFROMINI
- TARGET=AIORACERF3 # - TARGET=AIORACERF3
- TARGET=AIR32 # - TARGET=AIR32
- TARGET=ALIENFLIGHTF1 # - TARGET=ALIENFLIGHTF1
- TARGET=ALIENFLIGHTF3 - TARGET=ALIENFLIGHTF3
- TARGET=ALIENFLIGHTF4 - TARGET=ALIENFLIGHTF4
- TARGET=BLUEJAYF4 - TARGET=BLUEJAYF4
- TARGET=CC3D - TARGET=CC3D
- TARGET=CC3D_OPBL - TARGET=CC3D_OPBL
- TARGET=CHEBUZZF3 # - TARGET=CHEBUZZF3
- TARGET=CJMCU # - TARGET=CJMCU
- TARGET=COLIBRI # - TARGET=COLIBRI
- TARGET=COLIBRI_RACE # - TARGET=COLIBRI_RACE
- TARGET=DOGE # - TARGET=DOGE
- TARGET=EUSTM32F103RC # - TARGET=EUSTM32F103RC
- TARGET=F4BY # - TARGET=F4BY
- TARGET=FURYF3 # - TARGET=FURYF3
- TARGET=FURYF4 - TARGET=FURYF4
- TARGET=IRCFUSIONF3 # - TARGET=IRCFUSIONF3
- TARGET=KISSFC # - TARGET=KISSFC
- TARGET=LUX_RACE # - TARGET=LUX_RACE
- TARGET=MICROSCISKY # - TARGET=MICROSCISKY
- TARGET=MOTOLAB # - TARGET=MOTOLAB
- TARGET=NAZE - TARGET=NAZE
- TARGET=OLIMEXINO # - TARGET=OLIMEXINO
- TARGET=OMNIBUS # - TARGET=OMNIBUS
- TARGET=OMNIBUSF4 # - TARGET=OMNIBUSF4
- TARGET=PIKOBLX # - TARGET=PIKOBLX
- TARGET=PORT103R # - TARGET=PORT103R
- TARGET=REVO - TARGET=REVO
- TARGET=REVONANO # - TARGET=REVONANO
- TARGET=REVO_OPBL # - TARGET=REVO_OPBL
- TARGET=RMDO # - TARGET=RMDO
- TARGET=SINGULARITY # - TARGET=SINGULARITY
- TARGET=SIRINFPV # - TARGET=SIRINFPV
- TARGET=SPARKY - TARGET=SPARKY
- TARGET=SPARKY2 # - TARGET=SPARKY2
- TARGET=SPARKY_OPBL # - TARGET=SPARKY_OPBL
- TARGET=SPRACINGF3 - TARGET=SPRACINGF3
- TARGET=SPRACINGF3EVO - TARGET=SPRACINGF3EVO
- TARGET=SPRACINGF3MINI # - TARGET=SPRACINGF3MINI
- TARGET=STM32F3DISCOVERY - TARGET=STM32F3DISCOVERY
- TARGET=VRRACE # - TARGET=VRRACE
- TARGET=X_RACERSPI # - TARGET=X_RACERSPI
- TARGET=ZCOREF3 # - TARGET=ZCOREF3
# use new docker environment # use new docker environment
sudo: false sudo: false

View file

@ -208,7 +208,7 @@ static void resetPidProfile(pidProfile_t *pidProfile)
pidProfile->D8[ROLL] = 20; pidProfile->D8[ROLL] = 20;
pidProfile->P8[PITCH] = 60; pidProfile->P8[PITCH] = 60;
pidProfile->I8[PITCH] = 60; pidProfile->I8[PITCH] = 60;
pidProfile->D8[PITCH] = 25; pidProfile->D8[PITCH] = 22;
pidProfile->P8[YAW] = 80; pidProfile->P8[YAW] = 80;
pidProfile->I8[YAW] = 45; pidProfile->I8[YAW] = 45;
pidProfile->D8[YAW] = 20; pidProfile->D8[YAW] = 20;
@ -234,15 +234,15 @@ static void resetPidProfile(pidProfile_t *pidProfile)
pidProfile->yaw_p_limit = YAW_P_LIMIT_MAX; pidProfile->yaw_p_limit = YAW_P_LIMIT_MAX;
pidProfile->yaw_lpf_hz = 80; pidProfile->yaw_lpf_hz = 80;
pidProfile->rollPitchItermIgnoreRate = 200; pidProfile->rollPitchItermIgnoreRate = 130;
pidProfile->yawItermIgnoreRate = 50; pidProfile->yawItermIgnoreRate = 32;
pidProfile->dterm_filter_type = FILTER_BIQUAD; pidProfile->dterm_filter_type = FILTER_BIQUAD;
pidProfile->dterm_lpf_hz = 100; // filtering ON by default pidProfile->dterm_lpf_hz = 100; // filtering ON by default
pidProfile->dterm_notch_hz = 0; pidProfile->dterm_notch_hz = 0;
pidProfile->dterm_notch_cutoff = 150; pidProfile->dterm_notch_cutoff = 150;
pidProfile->deltaMethod = DELTA_FROM_MEASUREMENT; pidProfile->deltaMethod = DELTA_FROM_MEASUREMENT;
pidProfile->vbatPidCompensation = 0; pidProfile->vbatPidCompensation = 0;
pidProfile->zeroThrottleStabilisation = PID_STABILISATION_OFF; pidProfile->pidAtMinThrottle = PID_STABILISATION_OFF;
// Betaflight PID controller parameters // Betaflight PID controller parameters
pidProfile->ptermSetpointWeight = 75; pidProfile->ptermSetpointWeight = 75;
@ -312,10 +312,9 @@ void resetEscAndServoConfig(escAndServoConfig_t *escAndServoConfig)
{ {
#ifdef BRUSHED_MOTORS #ifdef BRUSHED_MOTORS
escAndServoConfig->minthrottle = 1000; escAndServoConfig->minthrottle = 1000;
escAndServoConfig->maxthrottle = 2000;
#else #else
escAndServoConfig->minthrottle = 1150; escAndServoConfig->maxthrottle = 2000;
escAndServoConfig->maxthrottle = 1850; escAndServoConfig->minthrottle = 1070;
#endif #endif
escAndServoConfig->mincommand = 1000; escAndServoConfig->mincommand = 1000;
escAndServoConfig->servoCenterPulse = 1500; escAndServoConfig->servoCenterPulse = 1500;

View file

@ -537,7 +537,7 @@ void processRx(void)
This is needed to prevent Iterm winding on the ground, but keep full stabilisation on 0 throttle while in air */ This is needed to prevent Iterm winding on the ground, but keep full stabilisation on 0 throttle while in air */
if (throttleStatus == THROTTLE_LOW && !airmodeIsActivated) { if (throttleStatus == THROTTLE_LOW && !airmodeIsActivated) {
pidResetErrorGyroState(); pidResetErrorGyroState();
if (currentProfile->pidProfile.zeroThrottleStabilisation) if (currentProfile->pidProfile.pidAtMinThrottle)
pidStabilisationState(PID_STABILISATION_ON); pidStabilisationState(PID_STABILISATION_ON);
else else
pidStabilisationState(PID_STABILISATION_OFF); pidStabilisationState(PID_STABILISATION_OFF);

View file

@ -90,7 +90,7 @@ typedef struct pidProfile_s {
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 vbatPidCompensation; // Scale PIDsum to battery voltage uint8_t vbatPidCompensation; // Scale PIDsum to battery voltage
uint8_t zeroThrottleStabilisation; // Disable/Enable zero throttle stabilisation. Normally even without airmode P and D would be active. uint8_t pidAtMinThrottle; // Disable/Enable pids on zero throttle. Normally even without airmode P and D would be active.
// Betaflight PID controller parameters // Betaflight PID controller parameters
uint8_t toleranceBand; // Error tolerance area where toleranceBandReduction is applied under certain circumstances uint8_t toleranceBand; // Error tolerance area where toleranceBandReduction is applied under certain circumstances

View file

@ -211,7 +211,7 @@ void pidBetaflight(const pidProfile_t *pidProfile, uint16_t max_angle_inclinatio
// -----calculate I component. // -----calculate I component.
// Reduce strong Iterm accumulation during higher stick inputs // Reduce strong Iterm accumulation during higher stick inputs
float accumulationThreshold = (axis == YAW) ? pidProfile->yawItermIgnoreRate : pidProfile->rollPitchItermIgnoreRate; float accumulationThreshold = (axis == YAW) ? pidProfile->yawItermIgnoreRate : pidProfile->rollPitchItermIgnoreRate;
float setpointRateScaler = constrainf(1.0f - (1.5f * (ABS(setpointRate[axis]) / accumulationThreshold)), 0.0f, 1.0f); float setpointRateScaler = constrainf(1.0f - (ABS(setpointRate[axis]) / accumulationThreshold), 0.0f, 1.0f);
// Handle All windup Scenarios // Handle All windup Scenarios
// limit maximum integrator value to prevent WindUp // limit maximum integrator value to prevent WindUp

View file

@ -451,6 +451,7 @@ static const char * const lookupTableAccHardware[] = {
"LSM303DLHC", "LSM303DLHC",
"MPU6000", "MPU6000",
"MPU6500", "MPU6500",
"MPU9250",
"FAKE" "FAKE"
}; };
@ -790,8 +791,8 @@ const clivalue_t valueTable[] = {
{ "servo_lowpass_enable", VAR_INT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.mixerConfig.servo_lowpass_enable, .config.lookup = { TABLE_OFF_ON } }, { "servo_lowpass_enable", VAR_INT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.mixerConfig.servo_lowpass_enable, .config.lookup = { TABLE_OFF_ON } },
#endif #endif
{ "rc_rate", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcRate8, .config.minmax = { 0, 300 } }, { "rc_rate", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcRate8, .config.minmax = { 0, 255 } },
{ "rc_rate_yaw", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcYawRate8, .config.minmax = { 0, 300 } }, { "rc_rate_yaw", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcYawRate8, .config.minmax = { 0, 255 } },
{ "rc_expo", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcExpo8, .config.minmax = { 0, 100 } }, { "rc_expo", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcExpo8, .config.minmax = { 0, 100 } },
{ "rc_yaw_expo", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcYawExpo8, .config.minmax = { 0, 100 } }, { "rc_yaw_expo", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcYawExpo8, .config.minmax = { 0, 100 } },
{ "thr_mid", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].thrMid8, .config.minmax = { 0, 100 } }, { "thr_mid", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].thrMid8, .config.minmax = { 0, 100 } },
@ -842,7 +843,7 @@ const clivalue_t valueTable[] = {
{ "dterm_notch_hz", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.dterm_notch_hz, .config.minmax = { 0, 500 } }, { "dterm_notch_hz", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.dterm_notch_hz, .config.minmax = { 0, 500 } },
{ "dterm_notch_cutoff", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.dterm_notch_cutoff, .config.minmax = { 1, 500 } }, { "dterm_notch_cutoff", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.dterm_notch_cutoff, .config.minmax = { 1, 500 } },
{ "vbat_pid_compensation", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, &masterConfig.profile[0].pidProfile.vbatPidCompensation, .config.lookup = { TABLE_OFF_ON } }, { "vbat_pid_compensation", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, &masterConfig.profile[0].pidProfile.vbatPidCompensation, .config.lookup = { TABLE_OFF_ON } },
{ "zero_throttle_stabilisation",VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, &masterConfig.profile[0].pidProfile.zeroThrottleStabilisation, .config.lookup = { TABLE_OFF_ON } }, { "pid_at_min_throttle", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, &masterConfig.profile[0].pidProfile.pidAtMinThrottle, .config.lookup = { TABLE_OFF_ON } },
{ "pid_tolerance_band", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.toleranceBand, .config.minmax = {0, 200 } }, { "pid_tolerance_band", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.toleranceBand, .config.minmax = {0, 200 } },
{ "tolerance_band_reduction", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.toleranceBandReduction, .config.minmax = {0, 100 } }, { "tolerance_band_reduction", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.toleranceBandReduction, .config.minmax = {0, 100 } },
{ "zero_cross_allowance", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.zeroCrossAllowanceCount, .config.minmax = {0, 50 } }, { "zero_cross_allowance", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.zeroCrossAllowanceCount, .config.minmax = {0, 50 } },
@ -927,7 +928,6 @@ const clivalue_t valueTable[] = {
#define VALUE_COUNT (sizeof(valueTable) / sizeof(clivalue_t)) #define VALUE_COUNT (sizeof(valueTable) / sizeof(clivalue_t))
typedef union { typedef union {
int32_t int_value; int32_t int_value;
float float_value; float float_value;
@ -940,8 +940,6 @@ static void cliPrint(const char *str);
static void cliPrintf(const char *fmt, ...); static void cliPrintf(const char *fmt, ...);
static void cliWrite(uint8_t ch); static void cliWrite(uint8_t ch);
#define printSectionBreak() cliPrintf((char *)sectionBreak)
#define COMPARE_CONFIG(value) (masterConfig.value == defaultConfig.value) #define COMPARE_CONFIG(value) (masterConfig.value == defaultConfig.value)
static bool cliDumpPrintf(uint8_t dumpMask, bool equalsDefault, const char *format, ...); static bool cliDumpPrintf(uint8_t dumpMask, bool equalsDefault, const char *format, ...);
@ -1731,8 +1729,6 @@ static void printServo(uint8_t dumpMask, master_t *defaultConfig)
); );
} }
printSectionBreak();
// print servo directions // print servo directions
unsigned int channel; unsigned int channel;
for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) { for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
@ -2022,10 +2018,9 @@ static void cliSdInfo(char *cmdline) {
; // Nothing more detailed to print ; // Nothing more detailed to print
break; break;
} }
cliPrint("\r\n");
break; break;
} }
cliPrint("\r\n");
} }
#endif #endif
@ -2326,14 +2321,12 @@ static void printConfig(char *cmdline, bool doDiff)
if ((dumpMask & DUMP_MASTER) || (dumpMask & DUMP_ALL)) { if ((dumpMask & DUMP_MASTER) || (dumpMask & DUMP_ALL)) {
cliPrint("\r\n# version\r\n"); cliPrint("\r\n# version\r\n");
cliVersion(NULL); cliVersion(NULL);
cliPrint("\r\n");
if ((dumpMask & (DUMP_ALL | DO_DIFF)) == (DUMP_ALL | DO_DIFF)) { if ((dumpMask & (DUMP_ALL | DO_DIFF)) == (DUMP_ALL | DO_DIFF)) {
cliPrint("\r\n# reset configuration to default settings\r\ndefaults\r\n"); cliPrint("\r\n# reset configuration to default settings\r\ndefaults\r\n");
} }
printSectionBreak(); cliPrint("\r\n# name\r\n");
cliPrint("# name\r\n");
printName(dumpMask); printName(dumpMask);
cliPrint("\r\n# mixer\r\n"); cliPrint("\r\n# mixer\r\n");
@ -2460,7 +2453,7 @@ static void printConfig(char *cmdline, bool doDiff)
cliPrint("\r\n# adjrange\r\n"); cliPrint("\r\n# adjrange\r\n");
printAdjustmentRange(dumpMask, &defaultConfig); printAdjustmentRange(dumpMask, &defaultConfig);
cliPrintf("\r\n# rxrange\r\n"); cliPrint("\r\n# rxrange\r\n");
printRxRange(dumpMask, &defaultConfig); printRxRange(dumpMask, &defaultConfig);
#ifdef USE_SERVOS #ifdef USE_SERVOS
@ -2519,15 +2512,10 @@ static void cliDumpProfile(uint8_t profileIndex, uint8_t dumpMask, master_t *def
{ {
if (profileIndex >= MAX_PROFILE_COUNT) // Faulty values if (profileIndex >= MAX_PROFILE_COUNT) // Faulty values
return; return;
changeProfile(profileIndex); changeProfile(profileIndex);
cliPrint("\r\n# profile\r\n"); cliPrint("\r\n# profile\r\n");
cliProfile(""); cliProfile("");
printSectionBreak();
dumpValues(PROFILE_VALUE, dumpMask, defaultConfig); dumpValues(PROFILE_VALUE, dumpMask, defaultConfig);
cliRateProfile("");
} }
static void cliDumpRateProfile(uint8_t rateProfileIndex, uint8_t dumpMask, master_t *defaultConfig) static void cliDumpRateProfile(uint8_t rateProfileIndex, uint8_t dumpMask, master_t *defaultConfig)
@ -2537,8 +2525,6 @@ static void cliDumpRateProfile(uint8_t rateProfileIndex, uint8_t dumpMask, maste
changeControlRateProfile(rateProfileIndex); changeControlRateProfile(rateProfileIndex);
cliPrint("\r\n# rateprofile\r\n"); cliPrint("\r\n# rateprofile\r\n");
cliRateProfile(""); cliRateProfile("");
printSectionBreak();
dumpValues(PROFILE_RATE_VALUE, dumpMask, defaultConfig); dumpValues(PROFILE_RATE_VALUE, dumpMask, defaultConfig);
} }
@ -3338,7 +3324,7 @@ static void cliVersion(char *cmdline)
{ {
UNUSED(cmdline); UNUSED(cmdline);
cliPrintf("# BetaFlight/%s %s %s / %s (%s)", cliPrintf("# BetaFlight/%s %s %s / %s (%s)\r\n",
targetName, targetName,
FC_VERSION_STRING, FC_VERSION_STRING,
buildDate, buildDate,