Fix multicopter stabilized mode throttle scale jump during takeoff #20031
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.
Describe problem solved by this pull request
#12542 made the lowest possible throttle value commanded by stick in Stabilized mode before taking off 0. The real world problem with this is that when takeoff is detected then the entire throttle scaling range jumps from
[0, MPC_MANTHR_MIN] to [MPC_MANTHR_MIN, MPC_MANTHR_MIN].
As a result whenever MPC_MANTHR_MIN is not set to 0 there is a thrust jump on every takeoff just at the moment takeoff is detected even when the stick is moved continuously.
Describe your solution
Because of this, I suggest reverting to having a higher throttle value from the beginning on because it's less complicated and there's no obvious value in starting out with zero thrust if it's anyways not possible to go back to zero for safety once takeoff is detected.
Test data / coverage
I tested this in simulation:
Additional context
I found this problem while working on a helicopter that is really sensitive to thrust setpoint jumps. It twitched frightening on every takeoff in Stabilized mode because of this bug: