Remove unnecessary complicated expo power

This commit is contained in:
borisbstyle 2016-09-06 01:28:26 +02:00
parent 2987c7d8c8
commit efd43059b5
5 changed files with 4 additions and 10 deletions

View File

@ -172,7 +172,7 @@ static uint32_t activeFeaturesLatch = 0;
static uint8_t currentControlRateProfileIndex = 0;
controlRateConfig_t *currentControlRateProfile;
static const uint8_t EEPROM_CONF_VERSION = 145;
static const uint8_t EEPROM_CONF_VERSION = 144;
static void resetAccelerometerTrims(flightDynamicsTrims_t *accelerometerTrims)
{
@ -191,7 +191,6 @@ static void resetControlRateConfig(controlRateConfig_t *controlRateConfig)
controlRateConfig->dynThrPID = 10;
controlRateConfig->rcYawExpo8 = 0;
controlRateConfig->tpa_breakpoint = 1650;
controlRateConfig->rcExpoPwr = 3;
for (uint8_t axis = 0; axis < FLIGHT_DYNAMICS_INDEX_COUNT; axis++) {
controlRateConfig->rates[axis] = 70;

View File

@ -152,7 +152,6 @@ typedef struct controlRateConfig_s {
uint8_t dynThrPID;
uint8_t rcYawExpo8;
uint16_t tpa_breakpoint; // Breakpoint where TPA is activated
uint8_t rcExpoPwr;
} controlRateConfig_t;
extern int16_t rcCommand[4];

View File

@ -800,7 +800,6 @@ const clivalue_t valueTable[] = {
{ "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_yaw_expo", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcYawExpo8, .config.minmax = { 0, 100 } },
{ "rc_expo_power", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcExpoPwr, .config.minmax = { 2, 4 } },
{ "thr_mid", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].thrMid8, .config.minmax = { 0, 100 } },
{ "thr_expo", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].thrExpo8, .config.minmax = { 0, 100 } },
{ "roll_srate", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rates[FD_ROLL], .config.minmax = { 0, CONTROL_RATE_CONFIG_ROLL_PITCH_RATE_MAX } },

View File

@ -821,7 +821,7 @@ static bool processOutCommand(uint8_t cmdMSP)
serialize16((uint16_t)gyro.targetLooptime);
break;
case MSP_RC_TUNING:
headSerialReply(13);
headSerialReply(12);
serialize8(currentControlRateProfile->rcRate8);
serialize8(currentControlRateProfile->rcExpo8);
for (i = 0 ; i < 3; i++) {
@ -833,7 +833,6 @@ static bool processOutCommand(uint8_t cmdMSP)
serialize16(currentControlRateProfile->tpa_breakpoint);
serialize8(currentControlRateProfile->rcYawExpo8);
serialize8(currentControlRateProfile->rcYawRate8);
serialize8(currentControlRateProfile->rcExpoPwr);
break;
case MSP_PID:
headSerialReply(3 * PID_ITEM_COUNT);
@ -1426,9 +1425,6 @@ static bool processInCommand(void)
if (currentPort->dataSize >= 12) {
currentControlRateProfile->rcYawRate8 = read8();
}
if (currentPort->dataSize >=13) {
currentControlRateProfile->rcExpoPwr = read8();
}
} else {
headSerialError(0);
}

View File

@ -174,6 +174,7 @@ bool isCalibrating()
}
#define RC_RATE_INCREMENTAL 14.54f
#define RC_EXPO_POWER 3
float calculateSetpointRate(int axis, int16_t rc) {
float angleRate, rcRate, rcSuperfactor, rcCommandf;
@ -193,7 +194,7 @@ float calculateSetpointRate(int axis, int16_t rc) {
if (rcExpo) {
float expof = rcExpo / 100.0f;
rcCommandf = rcCommandf * powerf(rcInput[axis], currentControlRateProfile->rcExpoPwr) * expof + rcCommandf * (1-expof);
rcCommandf = rcCommandf * powerf(rcInput[axis], RC_EXPO_POWER) * expof + rcCommandf * (1-expof);
}
angleRate = 200.0f * rcRate * rcCommandf;