Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multicopter stabilized mode throttle scale jump during takeoff #20031

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Aug 10, 2022

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:
image

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:
image

2fbb70d 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 zero there is a thrust jump
on every takeoff just at the moment takeoff is detected even when the
stick is moved continuously.

Because of this I suggest to revert 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 anyways not
possible to go back to zero for safety once takeoff is detected.
@MaEtUgR MaEtUgR self-assigned this Aug 10, 2022
@MaEtUgR MaEtUgR changed the title Fix mc stabilized throttle scale Fix multicopter stabilized mode throttle scale during takeoff Aug 10, 2022
@MaEtUgR MaEtUgR changed the title Fix multicopter stabilized mode throttle scale during takeoff Fix multicopter stabilized mode throttle scale jump during takeoff Aug 10, 2022
@MaEtUgR MaEtUgR merged commit 1f81101 into main Aug 11, 2022
@MaEtUgR MaEtUgR deleted the fix-mc-stabilized-throttle-scale branch August 11, 2022 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants