mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 17:25:18 +03:00
Drop yaw_jump_prevention_limit
This commit is contained in:
parent
8ec311e906
commit
80dc0e1d5a
5 changed files with 6 additions and 18 deletions
|
@ -1165,7 +1165,7 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
||||||
sbufWriteU16(dst, 0); //Legacy, no longer in use async processing value
|
sbufWriteU16(dst, 0); //Legacy, no longer in use async processing value
|
||||||
sbufWriteU8(dst, pidProfile()->heading_hold_rate_limit);
|
sbufWriteU8(dst, pidProfile()->heading_hold_rate_limit);
|
||||||
sbufWriteU8(dst, HEADING_HOLD_ERROR_LPF_FREQ);
|
sbufWriteU8(dst, HEADING_HOLD_ERROR_LPF_FREQ);
|
||||||
sbufWriteU16(dst, mixerConfig()->yaw_jump_prevention_limit);
|
sbufWriteU16(dst, 0);
|
||||||
sbufWriteU8(dst, gyroConfig()->gyro_lpf);
|
sbufWriteU8(dst, gyroConfig()->gyro_lpf);
|
||||||
sbufWriteU8(dst, accelerometerConfig()->acc_lpf_hz);
|
sbufWriteU8(dst, accelerometerConfig()->acc_lpf_hz);
|
||||||
sbufWriteU8(dst, 0); //reserved
|
sbufWriteU8(dst, 0); //reserved
|
||||||
|
@ -1398,7 +1398,7 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
||||||
|
|
||||||
case MSP2_INAV_MIXER:
|
case MSP2_INAV_MIXER:
|
||||||
sbufWriteU8(dst, mixerConfig()->yaw_motor_direction);
|
sbufWriteU8(dst, mixerConfig()->yaw_motor_direction);
|
||||||
sbufWriteU16(dst, mixerConfig()->yaw_jump_prevention_limit);
|
sbufWriteU16(dst, 0);
|
||||||
sbufWriteU8(dst, mixerConfig()->platformType);
|
sbufWriteU8(dst, mixerConfig()->platformType);
|
||||||
sbufWriteU8(dst, mixerConfig()->hasFlaps);
|
sbufWriteU8(dst, mixerConfig()->hasFlaps);
|
||||||
sbufWriteU16(dst, mixerConfig()->appliedMixerPreset);
|
sbufWriteU16(dst, mixerConfig()->appliedMixerPreset);
|
||||||
|
@ -2088,10 +2088,10 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
||||||
sbufReadU16(src); //Legacy, no longer in use async processing value
|
sbufReadU16(src); //Legacy, no longer in use async processing value
|
||||||
pidProfileMutable()->heading_hold_rate_limit = sbufReadU8(src);
|
pidProfileMutable()->heading_hold_rate_limit = sbufReadU8(src);
|
||||||
sbufReadU8(src); //HEADING_HOLD_ERROR_LPF_FREQ
|
sbufReadU8(src); //HEADING_HOLD_ERROR_LPF_FREQ
|
||||||
mixerConfigMutable()->yaw_jump_prevention_limit = sbufReadU16(src);
|
sbufReadU16(src); //Legacy yaw_jump_prevention_limit
|
||||||
gyroConfigMutable()->gyro_lpf = sbufReadU8(src);
|
gyroConfigMutable()->gyro_lpf = sbufReadU8(src);
|
||||||
accelerometerConfigMutable()->acc_lpf_hz = sbufReadU8(src);
|
accelerometerConfigMutable()->acc_lpf_hz = sbufReadU8(src);
|
||||||
sbufReadU8(src); //reserved
|
sbufReadU8(src); //reserved
|
||||||
sbufReadU8(src); //reserved
|
sbufReadU8(src); //reserved
|
||||||
sbufReadU8(src); //reserved
|
sbufReadU8(src); //reserved
|
||||||
sbufReadU8(src); //reserved
|
sbufReadU8(src); //reserved
|
||||||
|
@ -2733,7 +2733,7 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
||||||
|
|
||||||
case MSP2_INAV_SET_MIXER:
|
case MSP2_INAV_SET_MIXER:
|
||||||
mixerConfigMutable()->yaw_motor_direction = sbufReadU8(src);
|
mixerConfigMutable()->yaw_motor_direction = sbufReadU8(src);
|
||||||
mixerConfigMutable()->yaw_jump_prevention_limit = sbufReadU16(src);
|
sbufReadU16(src); // Was yaw_jump_prevention_limit
|
||||||
mixerConfigMutable()->platformType = sbufReadU8(src);
|
mixerConfigMutable()->platformType = sbufReadU8(src);
|
||||||
mixerConfigMutable()->hasFlaps = sbufReadU8(src);
|
mixerConfigMutable()->hasFlaps = sbufReadU8(src);
|
||||||
mixerConfigMutable()->appliedMixerPreset = sbufReadU16(src);
|
mixerConfigMutable()->appliedMixerPreset = sbufReadU16(src);
|
||||||
|
|
|
@ -685,9 +685,6 @@ groups:
|
||||||
- name: yaw_motor_direction
|
- name: yaw_motor_direction
|
||||||
min: -1
|
min: -1
|
||||||
max: 1
|
max: 1
|
||||||
- name: yaw_jump_prevention_limit
|
|
||||||
min: YAW_JUMP_PREVENTION_LIMIT_LOW
|
|
||||||
max: YAW_JUMP_PREVENTION_LIMIT_HIGH
|
|
||||||
- name: platform_type
|
- name: platform_type
|
||||||
field: platformType
|
field: platformType
|
||||||
type: uint8_t
|
type: uint8_t
|
||||||
|
|
|
@ -70,11 +70,10 @@ PG_RESET_TEMPLATE(flight3DConfig_t, flight3DConfig,
|
||||||
.neutral3d = 1460
|
.neutral3d = 1460
|
||||||
);
|
);
|
||||||
|
|
||||||
PG_REGISTER_WITH_RESET_TEMPLATE(mixerConfig_t, mixerConfig, PG_MIXER_CONFIG, 1);
|
PG_REGISTER_WITH_RESET_TEMPLATE(mixerConfig_t, mixerConfig, PG_MIXER_CONFIG, 2);
|
||||||
|
|
||||||
PG_RESET_TEMPLATE(mixerConfig_t, mixerConfig,
|
PG_RESET_TEMPLATE(mixerConfig_t, mixerConfig,
|
||||||
.yaw_motor_direction = 1,
|
.yaw_motor_direction = 1,
|
||||||
.yaw_jump_prevention_limit = 200,
|
|
||||||
.platformType = PLATFORM_MULTIROTOR,
|
.platformType = PLATFORM_MULTIROTOR,
|
||||||
.hasFlaps = false,
|
.hasFlaps = false,
|
||||||
.appliedMixerPreset = -1, //This flag is not available in CLI and used by Configurator only
|
.appliedMixerPreset = -1, //This flag is not available in CLI and used by Configurator only
|
||||||
|
@ -291,11 +290,6 @@ void FAST_CODE NOINLINE mixTable(const float dT)
|
||||||
input[ROLL] = axisPID[ROLL];
|
input[ROLL] = axisPID[ROLL];
|
||||||
input[PITCH] = axisPID[PITCH];
|
input[PITCH] = axisPID[PITCH];
|
||||||
input[YAW] = axisPID[YAW];
|
input[YAW] = axisPID[YAW];
|
||||||
|
|
||||||
if (motorCount >= 4 && mixerConfig()->yaw_jump_prevention_limit < YAW_JUMP_PREVENTION_LIMIT_HIGH) {
|
|
||||||
// prevent "yaw jump" during yaw correction
|
|
||||||
input[YAW] = constrain(input[YAW], -mixerConfig()->yaw_jump_prevention_limit - ABS(rcCommand[YAW]), mixerConfig()->yaw_jump_prevention_limit + ABS(rcCommand[YAW]));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initial mixer concept by bdoiron74 reused and optimized for Air Mode
|
// Initial mixer concept by bdoiron74 reused and optimized for Air Mode
|
||||||
|
|
|
@ -64,7 +64,6 @@ PG_DECLARE_ARRAY(motorMixer_t, MAX_SUPPORTED_MOTORS, primaryMotorMixer);
|
||||||
|
|
||||||
typedef struct mixerConfig_s {
|
typedef struct mixerConfig_s {
|
||||||
int8_t yaw_motor_direction;
|
int8_t yaw_motor_direction;
|
||||||
uint16_t yaw_jump_prevention_limit; // make limit configurable (original fixed value was 100)
|
|
||||||
uint8_t platformType;
|
uint8_t platformType;
|
||||||
bool hasFlaps;
|
bool hasFlaps;
|
||||||
int16_t appliedMixerPreset;
|
int16_t appliedMixerPreset;
|
||||||
|
|
|
@ -98,8 +98,6 @@ void targetConfiguration(void)
|
||||||
boardAlignmentMutable()->pitchDeciDegrees = 165;
|
boardAlignmentMutable()->pitchDeciDegrees = 165;
|
||||||
boardAlignmentMutable()->yawDeciDegrees = 0;
|
boardAlignmentMutable()->yawDeciDegrees = 0;
|
||||||
|
|
||||||
mixerConfigMutable()->yaw_jump_prevention_limit = 200;
|
|
||||||
|
|
||||||
imuConfigMutable()->small_angle = 30;
|
imuConfigMutable()->small_angle = 30;
|
||||||
|
|
||||||
gpsConfigMutable()->provider = GPS_UBLOX;
|
gpsConfigMutable()->provider = GPS_UBLOX;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue