Skip to content

Commit

Permalink
Use at least TRIM_THROTTLE during the climb
Browse files Browse the repository at this point in the history
  • Loading branch information
Georacer authored and tridge committed May 29, 2024
1 parent 7a3b560 commit 1a782b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libraries/AP_TECS/AP_TECS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,12 @@ void AP_TECS::update_pitch_throttle(int32_t hgt_dem_cm,
} else {
_THRmaxf = aparm.throttle_max * 0.01f;
}
_THRminf = aparm.throttle_min * 0.01f;
// Apply at least trim throttle during the whole takeoff climb.
if (_flight_stage == AP_FixedWing::FlightStage::TAKEOFF ) {
_THRminf = aparm.throttle_cruise * 0.01f;
} else { // Otherwise, during normal situations let regular limit.
_THRminf = aparm.throttle_min * 0.01f;
}

// min of 1% throttle range to prevent a numerical error
_THRmaxf = MAX(_THRmaxf, _THRminf+0.01);
Expand Down

0 comments on commit 1a782b7

Please sign in to comment.