Add vertical emergency braking in auto mode #18277
Merged
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
If the drone is sinking really fast (i.e: well above usual maximum descent speed) and if the user switches to an auto mode to recover (RTL or other), the trajectory generator will generate a smooth (from design parameters) that usually creates a too long braking distance. Furthermore, the setpoints are clipped by the velocity controller, creating a hard stop followed by a controlled descent (that looks like an overshoot).
Describe your solution
If the drone is falling at a speed above twice the maximum downward speed, the trajectory generator enters an "emergency braking mode" that sets higher acceleration and jerk parameters (9.81m/s2 and 9.81m/s3) until the vertical velocity trajectory reaches 0m/s. After this, it goes back to normal and uses the usual parameters to continue the mission.
Test data / coverage
SITL:
https://logs.px4.io/plot_app?log=c47a8da3-6bc5-4d9f-88d6-3643465b0c42
And real flight tests. We use that on our vehicles for ~3 months