diff --git a/src/main/fc/fc_msp.c b/src/main/fc/fc_msp.c index 282e03d4a3..9896808b96 100644 --- a/src/main/fc/fc_msp.c +++ b/src/main/fc/fc_msp.c @@ -1164,7 +1164,7 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst) sbufWriteU16(dst, currentPidProfile->rateAccelLimit); sbufWriteU16(dst, currentPidProfile->yawRateAccelLimit); sbufWriteU8(dst, currentPidProfile->levelAngleLimit); - sbufWriteU8(dst, currentPidProfile->levelSensitivity); + sbufWriteU8(dst, 0); // was pidProfile.levelSensitivity sbufWriteU16(dst, currentPidProfile->itermThrottleThreshold); sbufWriteU16(dst, currentPidProfile->itermAcceleratorGain); break; @@ -1585,7 +1585,7 @@ static mspResult_e mspFcProcessInCommand(uint8_t cmdMSP, sbuf_t *src) currentPidProfile->yawRateAccelLimit = sbufReadU16(src); if (sbufBytesRemaining(src) >= 2) { currentPidProfile->levelAngleLimit = sbufReadU8(src); - currentPidProfile->levelSensitivity = sbufReadU8(src); + sbufReadU8(src); // was pidProfile.levelSensitivity } if (sbufBytesRemaining(src) >= 4) { currentPidProfile->itermThrottleThreshold = sbufReadU16(src); diff --git a/src/main/fc/settings.c b/src/main/fc/settings.c index 2270864da6..49063490c7 100644 --- a/src/main/fc/settings.c +++ b/src/main/fc/settings.c @@ -596,8 +596,7 @@ const clivalue_t valueTable[] = { { "i_vel", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 0, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, pid[PID_VEL].I) }, { "d_vel", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 0, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, pid[PID_VEL].D) }, - { "level_sensitivity", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 10, 200 }, PG_PID_PROFILE, offsetof(pidProfile_t, levelSensitivity) }, - { "level_limit", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 10, 120 }, PG_PID_PROFILE, offsetof(pidProfile_t, levelAngleLimit) }, + { "level_limit", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 10, 90 }, PG_PID_PROFILE, offsetof(pidProfile_t, levelAngleLimit) }, { "horizon_tilt_effect", VAR_UINT8 | PROFILE_VALUE, .config.minmax = { 0, 250 }, PG_PID_PROFILE, offsetof(pidProfile_t, horizon_tilt_effect) }, { "horizon_tilt_expert_mode", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_PID_PROFILE, offsetof(pidProfile_t, horizon_tilt_expert_mode) }, diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index 842d172094..fdede37e33 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -69,7 +69,7 @@ PG_RESET_TEMPLATE(pidConfig_t, pidConfig, .pid_process_denom = PID_PROCESS_DENOM_DEFAULT ); -PG_REGISTER_ARRAY_WITH_RESET_FN(pidProfile_t, MAX_PROFILE_COUNT, pidProfiles, PG_PID_PROFILE, 1); +PG_REGISTER_ARRAY_WITH_RESET_FN(pidProfile_t, MAX_PROFILE_COUNT, pidProfiles, PG_PID_PROFILE, 2); void resetPidProfile(pidProfile_t *pidProfile) { @@ -98,7 +98,6 @@ void resetPidProfile(pidProfile_t *pidProfile) .vbatPidCompensation = 0, .pidAtMinThrottle = PID_STABILISATION_ON, .levelAngleLimit = 55, - .levelSensitivity = 55, .setpointRelaxRatio = 100, .dtermSetpointWeight = 60, .yawRateAccelLimit = 100, @@ -354,7 +353,7 @@ static float calcHorizonLevelStrength(void) static float pidLevel(int axis, const pidProfile_t *pidProfile, const rollAndPitchTrims_t *angleTrim, float currentPidSetpoint) { // calculate error angle and limit the angle to the max inclination // rcDeflection is in range [-1.0, 1.0] - float angle = pidProfile->levelSensitivity * getRcDeflection(axis); + float angle = pidProfile->levelAngleLimit * getRcDeflection(axis); #ifdef GPS angle += GPS_angle[axis]; #endif diff --git a/src/main/flight/pid.h b/src/main/flight/pid.h index 2baa17b60f..98a5459ac5 100644 --- a/src/main/flight/pid.h +++ b/src/main/flight/pid.h @@ -85,7 +85,6 @@ typedef struct pidProfile_s { uint8_t vbatPidCompensation; // Scale PIDsum to battery voltage uint8_t pidAtMinThrottle; // Disable/Enable pids on zero throttle. Normally even without airmode P and D would be active. uint8_t levelAngleLimit; // Max angle in degrees in level mode - uint8_t levelSensitivity; // Angle mode sensitivity reflected in degrees assuming user using full stick uint8_t horizon_tilt_effect; // inclination factor for Horizon mode uint8_t horizon_tilt_expert_mode; // OFF or ON