Skip to content

Commit

Permalink
tecs: make sure that in fast descend the throttle is not completely s…
Browse files Browse the repository at this point in the history
…hut down while still climbing
  • Loading branch information
KonradRudin committed Jul 12, 2024
1 parent 33be5d8 commit 7f0869c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/tecs/TECS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,13 @@ void TECSControl::_calcThrottleControl(float dt, const SpecificEnergyRates &spec
float throttle_setpoint{param.throttle_min};

if (1.f - param.fast_descend < FLT_EPSILON) {
// During fast descend, we control airspeed over the pitch control loop and give minimal thrust.
throttle_setpoint = param.throttle_min;
// During fast descend, we control airspeed over the pitch control loop. Give minimal thrust as soon as we are descending
if (specific_energy_rates.spe_rate.estimate > 0) { // We have a positive altitude rate and are stil climbing
throttle_setpoint = param.throttle_trim; // Do not cut off throttle yet

} else {
throttle_setpoint = param.throttle_min;
}

} else {
_calcThrottleControlUpdate(dt, limit, ste_rate, param, flag);
Expand Down

0 comments on commit 7f0869c

Please sign in to comment.