From 5c4db1db56bd114c60256fe9d6a24bc342768bea Mon Sep 17 00:00:00 2001 From: Raphael Hunziker Date: Thu, 10 Sep 2026 21:40:31 +0200 Subject: [PATCH] servos: keep speed limit carry over when switching back The mixer switch carry over loop ended at the first INPUT_MIXER_SWITCH_HELPER rule. Switching a mixer profile back before the carry over of the previous switch had decayed therefore dropped its remaining filter state, the newly loaded rule restarted from zero and the servo jumped towards its mid position. Only the carry capacity ends the loop now, helper rules are carried over like any other speed limited rule. Fixes #11503 --- src/main/flight/servos.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/flight/servos.c b/src/main/flight/servos.c index 1c7c65b3899..010580edffa 100755 --- a/src/main/flight/servos.c +++ b/src/main/flight/servos.c @@ -231,10 +231,12 @@ void loadCustomServoMixer(void) // target-profile response. if (carryOverServoSpeedLimitsOnNextLoad) { for (int i = 0; i < servoRuleCount; i++) { - if(currentServoMixer[i].inputSource == INPUT_MIXER_SWITCH_HELPER || movefilterCount >= MAX_SERVO_RULES_SWITCH_CARRY) { - //will not carry over INPUT_MIXER_SWITCH_HELPER rules - break; + if (movefilterCount >= MAX_SERVO_RULES_SWITCH_CARRY) { + break; // no room left to carry more filter states } + // INPUT_MIXER_SWITCH_HELPER rules are carried over as well. They hold the + // still decaying output of an earlier switch, so dropping them would make + // the servo jump when switching back before that decay has finished. if(currentServoMixer[i].speed != 0 && fabsf(servoSpeedLimitFilter[i].state) > 0.01f) { servoMixerSwitchHelper[movefilterCount].targetChannel = currentServoMixer[i].targetChannel; servoMixerSwitchHelper[movefilterCount].speed = currentServoMixer[i].speed;