mc_pos_control: fix takeoff ramp gets amended by feed-forward #14821
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
I found an issue with the takeoff ramp when real world testing #14749 on the Holybro QAV250. But I found the issue is independent of that pr.
The thrust doesn't ramp nicely anymore like it was designed but depending on stick input can go up and down unexpectedly during the ramp up. This can lead to early land detection if the thrust goes up high enough and then back down because the ramp is not yet high enough.
The problem is: Because the takeoff ramp is a vertical velocity limit ramp for the nice user experience but the acceleration feed-forward can add on top of the output and depending on trajectory generation result in unwanted thrust changes during the ramp.
Describe your solution
I suppress the vertical acceleration feed-forward during the ramp.
Test data / coverage
It's reproducable in SITL with the correct configuration:
MPC_TKO_RAMP_T
5,MPC_JERK_MAX
20Before: https://review.px4.io/plot_app?log=ba57f51e-abaf-4990-ad34-64b3cef56d11


After: https://review.px4.io/plot_app?log=532b6cdd-5101-4007-82b6-529b1491e85b