-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
Plane: Fix inability to climb the last few meters of takeoff #28707
Conversation
When an airspeed sensor is not used, during a takeoff, the pitch angle is asymptotically driven to 0 as the takeoff altitude is approached. Some airplanes will then stop climbing and fail to reach altitude. If that happens, then minimum pitch is driven back up to taekoff pitch gradually within 5 seconds.
Weather is currently not favorable for a test flight but I'll try to test in case it gets better. Edit: Please also address the forced 100% throttle. |
Two short flights. IMO the whole thing is connected to a false climb-rate estimation. I have logs from a landing test session with 4.5.7 and I see level-off happening at 3m below target altitude, not 8m. EDIT: |
@@ -304,6 +304,14 @@ int16_t Plane::get_takeoff_pitch_min_cd(void) | |||
// if height-below-target has been initialized then use it to create and apply a scaler to the pitch_min | |||
if (auto_state.height_below_takeoff_to_level_off_cm != 0) { | |||
float scalar = remaining_height_to_target_cm / (float)auto_state.height_below_takeoff_to_level_off_cm; | |||
|
|||
const int32_t takeoff_end_delay_ms = AP_HAL::millis() - takeoff_state.level_off_start_time_ms - g.takeoff_pitch_limit_reduction_sec*1000; |
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.
const int32_t takeoff_end_delay_ms = AP_HAL::millis() - takeoff_state.level_off_start_time_ms - g.takeoff_pitch_limit_reduction_sec*1000; | |
const uint32_t takeoff_end_delay_ms = AP_HAL::millis() - takeoff_state.level_off_start_time_ms - g.takeoff_pitch_limit_reduction_sec*1000; |
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.
.... or at least something needs to change here; we rely on integer wrap semantics. Possibly break this into two separate statements.
@Georacer I'm surprised you didn't implement the expanding pitch window using TECS like we discussed, did it not work out? |
As I wrote in the description, the proposed solution of widening the TECS pitch limits and letting TECS take over and regulate the last few meters of the climb was not feasible: I did try it and it didn't give effective results. |
|
||
self.delay_sim_time(5) | ||
|
||
self.reboot_sitl(force=True) |
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.
self.reboot_sitl(force=True) | |
self.disarm_vehicle(force=True) |
.... we're going to restart SITL anyway, this is a little faster than rebooting.
@@ -304,6 +304,14 @@ int16_t Plane::get_takeoff_pitch_min_cd(void) | |||
// if height-below-target has been initialized then use it to create and apply a scaler to the pitch_min | |||
if (auto_state.height_below_takeoff_to_level_off_cm != 0) { | |||
float scalar = remaining_height_to_target_cm / (float)auto_state.height_below_takeoff_to_level_off_cm; | |||
|
|||
const int32_t takeoff_end_delay_ms = AP_HAL::millis() - takeoff_state.level_off_start_time_ms - g.takeoff_pitch_limit_reduction_sec*1000; | |||
if (takeoff_end_delay_ms > 0) { |
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.
This might be a linear_interpolate
?
discussed on EU dev call, decided just to declare the takeoff complete if we are in the taper off region and we timeout |
Can we also do something about the now forced 100% throttle? I argue that it's a wrong design decision not to fall back to TECS controlled throttle, means the airspeed sensor presence should not be evaluated here. It also adds to the issue here because it influences the climb-rate estimation. |
For this PR we definitely won't change the throttle strategy. Having a constant THR_MAX was a request from other developers, so you'd have to make your case on why this is a good idea. |
Superseded by #28792 |
Summary
This PR addresses #28685.
Details
This affects takeoffs without an airspeed sensor.
Cause
Some airframes will not climb at 0 pitch, regardless of throttle setting.
Thus, the current takeoff level-off strategy of asymptotically forcing pitch to 0, results in the aircraft to never climb the final few meters.
Reproduction
The behaviour was reproduced in SITL, by setting:
PTCH_TRIM_DEG
: -10.0TKOFF_THR_MAX
: 75.0Solution
After the expected time to complete the takeoff has elapsed, drive the desired pitch gradually back to takeoff pitch, over the next 5 seconds.
Testing
Before:
After:
Alternatives
The proposed solution of widening the TECS pitch limits and letting TECS take over and regulate the last few meters of the climb was not feasible:
During an airspeedless takeoff, TECS uses throttle to correct for altitude errors.
It would use pitch (if it was allowed) to correct for airspeed errors).
Thus letting TECS command the pitch angle would not help.