Fix servo throttle mix outputting wrong position when disarmed #11318
+10
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
Summary
Fix a safety issue where reversed throttle servos and servos with negative mixer weights go to the wrong position when disarmed.
When disarmed, the servo mixer was unconditionally overwriting servo outputs with
motorConfig()->mincommand(typically 1000µs) for any servo with a throttle mixer rule. This ignored servo reversal (negativeservoParamsrate) and negative mixer weights, causing certain servo configurations to output full throttle instead of minimum on disarm.Changes
INPUT_STABILIZED_THROTTLEandINPUT_RC_THROTTLE) to -500 (minimum) before the mixer loop when disarmed, so the existing mixer pipeline correctly computes safe positions accounting for servo reversal and negative weightsservoMixer()that was settingservo[target] = motorConfig()->mincommandTesting
Tested with SITL using automated MSP test script covering 5 scenarios:
All 5 tests pass after the fix. The two previously failing cases (reversed servo, negative weight) now correctly compute the safe position.
Built successfully for SITL, MATEKF405, and SPEEDYBEEF405WING.
PR Type
Bug fix
Description
Fixes safety issue where reversed throttle servos output wrong position when disarmed
Forces throttle inputs to minimum before mixer pipeline instead of post-hoc override
Ensures servo reversal and negative mixer weights are correctly accounted for
Removes broken unconditional mincommand override that ignored servo configuration
Diagram Walkthrough
File Walkthrough
servos.c
Replace post-hoc override with input forcingsrc/main/flight/servos.c
INPUT_STABILIZED_THROTTLEandINPUT_RC_THROTTLE) to -500 when disarmed, before the mixer loopexecutes
outputs to
motorConfig()->mincommandfor throttle-mixed servospositions accounting for servo reversal and negative mixer weights