parent
df159d195d
commit
127251cc99
|
@ -334,7 +334,6 @@ void resetRcControlsConfig(rcControlsConfig_t *rcControlsConfig) {
|
|||
|
||||
void resetMixerConfig(mixerConfig_t *mixerConfig) {
|
||||
mixerConfig->yaw_motor_direction = 1;
|
||||
mixerConfig->airmode_saturation_limit = 30;
|
||||
mixerConfig->yaw_jump_prevention_limit = 200;
|
||||
#ifdef USE_SERVOS
|
||||
mixerConfig->tri_unarmed_servo = 1;
|
||||
|
|
|
@ -854,11 +854,10 @@ void mixTable(void)
|
|||
for (i = 0; i < motorCount; i++) {
|
||||
rollPitchYawMix[i] = qMultiply(mixReduction,rollPitchYawMix[i]);
|
||||
}
|
||||
// Get the maximum correction by setting offset to center. Only active below 50% of saturation levels to reduce spazzing out in crashes
|
||||
if ((qPercent(mixReduction) > mixerConfig->airmode_saturation_limit) && IS_RC_MODE_ACTIVE(BOXAIRMODE)) {
|
||||
// Get the maximum correction by setting offset to center
|
||||
if (IS_RC_MODE_ACTIVE(BOXAIRMODE)) {
|
||||
throttleMin = throttleMax = throttleMin + (throttleRange / 2);
|
||||
}
|
||||
|
||||
} else {
|
||||
motorLimitReached = false;
|
||||
throttleMin = throttleMin + (rollPitchYawMixRange / 2);
|
||||
|
|
|
@ -71,7 +71,6 @@ typedef struct mixer_s {
|
|||
|
||||
typedef struct mixerConfig_s {
|
||||
int8_t yaw_motor_direction;
|
||||
uint8_t airmode_saturation_limit; // Percentage in airmode where the mixer stops trying to get maximum possible correction
|
||||
uint16_t yaw_jump_prevention_limit; // make limit configurable (original fixed value was 100)
|
||||
#ifdef USE_SERVOS
|
||||
uint8_t tri_unarmed_servo; // send tail servo correction pulses even when unarmed
|
||||
|
|
|
@ -630,7 +630,6 @@ const clivalue_t valueTable[] = {
|
|||
{ "yaw_control_direction", VAR_INT8 | MASTER_VALUE, &masterConfig.yaw_control_direction, .config.minmax = { -1, 1 } },
|
||||
|
||||
{ "yaw_motor_direction", VAR_INT8 | MASTER_VALUE, &masterConfig.mixerConfig.yaw_motor_direction, .config.minmax = { -1, 1 } },
|
||||
{ "airmode_saturation_limit", VAR_UINT8 | MASTER_VALUE, &masterConfig.mixerConfig.airmode_saturation_limit, .config.minmax = { 0, 100 } },
|
||||
{ "yaw_jump_prevention_limit", VAR_UINT16 | MASTER_VALUE, &masterConfig.mixerConfig.yaw_jump_prevention_limit, .config.minmax = { YAW_JUMP_PREVENTION_LIMIT_LOW, YAW_JUMP_PREVENTION_LIMIT_HIGH } },
|
||||
{ "yaw_p_limit", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.yaw_p_limit, .config.minmax = { YAW_P_LIMIT_MIN, YAW_P_LIMIT_MAX } },
|
||||
#ifdef USE_SERVOS
|
||||
|
|
|
@ -113,13 +113,12 @@ void setGyroSamplingSpeed(uint16_t looptime) {
|
|||
masterConfig.gyro_lpf = 0;
|
||||
gyroSampleRate = 125;
|
||||
maxDivider = 8;
|
||||
masterConfig.pid_process_denom = 1;
|
||||
if (looptime < 250) {
|
||||
masterConfig.acc_hardware = 1;
|
||||
masterConfig.baro_hardware = 1;
|
||||
masterConfig.mag_hardware = 1;
|
||||
masterConfig.pid_process_denom = 2;
|
||||
} else if (looptime < 1000) {
|
||||
masterConfig.pid_process_denom = 1;
|
||||
}
|
||||
} else {
|
||||
masterConfig.gyro_lpf = 1;
|
||||
|
@ -133,6 +132,7 @@ void setGyroSamplingSpeed(uint16_t looptime) {
|
|||
masterConfig.mag_hardware = 1;
|
||||
gyroSampleRate = 125;
|
||||
maxDivider = 8;
|
||||
masterConfig.pid_process_denom = 1;
|
||||
if (looptime < 250) {
|
||||
masterConfig.pid_process_denom = 3;
|
||||
} else if (looptime < 500) {
|
||||
|
@ -141,12 +141,6 @@ void setGyroSamplingSpeed(uint16_t looptime) {
|
|||
} else {
|
||||
masterConfig.pid_process_denom = 2;
|
||||
}
|
||||
} else {
|
||||
if (currentProfile->pidProfile.pidController == 2) {
|
||||
masterConfig.pid_process_denom = 2;
|
||||
} else {
|
||||
masterConfig.pid_process_denom = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
masterConfig.gyro_lpf = 1;
|
||||
|
|
Loading…
Reference in New Issue