WIP: Add IMMEDIATE_DESCEND_IN_AUTO FLIGHT_OPTION #28250
Closed
+7
−0
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.
Summary
This PR attempts to address a vulnerability in the case of a glider being let loose from a balloon.
Typically in the first moments of the flight the glider will operate with
TECS_SPDWEIGHT=0
and will also fly below its target altitude. Therefore it will pitch up and stall.The proposed solution is to ensure that the target altitude will always be lower than the current altitude, via the use of a new FLIGHT_OPTION bit.
Issue details
When a glider is let loose from a balloon, the airspeed sensor will be marked as unhealthy. I don't know of a good way to ensure that this will not happen.
As a result, TECS will not use it and TECS will switch to the equivalent of
TECS_SPDWEIGHT=0
(https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_TECS/AP_TECS.cpp#L946).Therefore, the pitch setpoint will take into account only altitude errors.
Now, right after getting released from the balloon, it is typical to run a complete mission, sometimes with a takeoff waypoint as well. The current waypoint is initialized at a high altitude.
When planning an altitude profile to the next (low down) waypoint,
Mode::update_target_altitude()
atmode.cpp:191
is passing an altitude reference to TECS that starts at the altitude of the previous waypoint (high up) and gradually reduces to the target altitude.The slider is the
wp_state.wp_proportion
.If the glider starts its drop to the opposite side of the next waypoint,
wp_proportion
will be 0 for a significant amount of time, while the plane tries to turn around.This will result in the target altitude staying high for long and causing the pitch setpoint to increase while the aircraft sinks:
This PR is an attempt to prevent this and this is the result that it achieves:
Drawbacks
I think this is quite a crude way to ensure that the target altitude will never be above us in this particular use case of a glider.
Probably a smarter (and less heavy-handed way) to achieve it would be better.