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
mc_pos_control: handle landed and takeoff setpoint limiting the same way #14326
Conversation
On this question:
From a UX perspective ramping from and to 0 would be preferable, because the minimum throttle is the throttle that enables the system to be safely descending, while in these situations a smooth spool-up and spool-down of the rotors creates trust of the user. Otherwise every flight starts with a scary "twitch" because the props go from 0 to idle throttle in a short amount of time. Same for landing: Running smoothly to zero is nicer compared to holding throttle and just switching off. |
Exactly what I thought. Twitch at the beginning and less useful land detection at the end because it doesn't go down to zero. I'm working on a way to have that possible. |
It cannot be considered a guarantee for safe descending because of the minimum thrust resulting in a downwards acceleration. So it depends on how long it's applied if the vertical end speed is still safe. I see it more as the guard to keep rotational control authority when not using airmode in the mixer (which is disabled by default for safety reasons). |
Sorry, that’s what I meant with “safe”. |
a622fcf
to
621ee3f
Compare
621ee3f
to
dd49ca5
Compare
I revisited the implementation and rebased on master. I also did quite extensive SITL testing. It now:
There is no thrust ramp down for ground contact yet, that's for another pr. Ready for review and testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
Tested on PixRacer V4Indoor Flight Test Procedure Notes Log https://review.px4.io/plot_app?log=28108a2a-8640-4416-a817-cd7bdd94087f Tested on CUAV nano V5Indoor Flight Test Procedure Notes Log https://review.px4.io/plot_app?log=b8e12d7a-3476-462a-946f-d9c26a9b8c37 |
Tested on NXP FMUK66 v3Indoor Flight
Procedure
Note
Log |
@PX4/testflights With this one it's most important to test takeoffs and landings in Altitude, Position and Auto Takeoff/Landing modes. Thanks in advance! |
@MaEtUgR We will test this on the field once the rain stops. Monday the rain should clear. |
to make sure the takeoff limitation is always done last.
This was only necessary for stabilized mode before #10805. The unit length thrust setpoint will anyways not be available anymore soon because it gets replaced with the acceleration setpoint in m/s².
The landing thrust limit was after the position controller and could be inconsistent with what the takeoff limit did. This resulted in different thrust values sequentially getting applied during landing.
Otherwise the takeoff ramp doesn't start with zero thrust and the land thrust cut cannot cut to zero.
619c218
to
ca9929d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still GTM
I'm quoting the test report by @fury1895:
Thanks for helping with testing! |
Describe problem solved by this pull request
@jkflying reported an effect I've seen before:
During a normal landing procedure the thrust gets first cut by the reaction to ground detected and then cut by the takeoff logic because the vehicle is back ready for another takeoff.
The problem is that the thrust and attitude limit while landing is in the loop order after the position controller ran and directly operates on the attitude setpoint skipping the position controllers minimum thrust limit. The takeoff thrust limitation on the other had is before the position controller and amends the input to it.
Describe your solution
I'm unifying the thrust and attitude limit logic to be in one place where it already was for the takeoff. Both logics for takeoff and landing do these things in common:
I still have to check if reactivating flight task and reseting the hover thrust is also desired otherwise they can be conditional for just the takeoff.
Describe possible alternatives
It's not 100% clear to me if
MPC_THR_MIN
should be the minimum thrust at all times even during landing and takeoff or if the takeoff ramp should always start at zero thrust and thrust should go down to zero after landing.Test data / coverage
Quick SITL test, needs more testing and review.