fix(tecs): base STE_rate_min on max_sink_rate not min_sink_rate

The altitude outer loop constrains its output to [-max_sink_rate,
+max_climb_rate]. STE_rate_max correctly mirrors this with max_climb_rate,
but STE_rate_min used min_sink_rate (sink at trim speed, min throttle).

When descent rate exceeds min_sink_rate the STE rate setpoint was
saturated at -min_sink_rate*g while the estimate reflected the actual
(more negative) energy rate. The resulting positive control error caused
the throttle controller to add thrust during steep commanded descents.

Use max_sink_rate for STE_rate_min so the representable energy rate range
is consistent with what the altitude controller can command.

Signed-off-by: Balduin <balduin@auterion.com>
This commit is contained in:
Balduin
2026-04-23 09:38:34 +02:00
parent d619ab5d27
commit 6b87eef4bd
+1 -1
View File
@@ -313,7 +313,7 @@ TECSControl::STERateLimit TECSControl::_calculateTotalEnergyRateLimit(const Para
TECSControl::STERateLimit limit;
// Calculate the specific total energy rate limits from the max throttle limits
limit.STE_rate_max = math::max(param.max_climb_rate, FLT_EPSILON) * CONSTANTS_ONE_G;
limit.STE_rate_min = - math::max(param.min_sink_rate, FLT_EPSILON) * CONSTANTS_ONE_G;
limit.STE_rate_min = - math::max(param.max_sink_rate, FLT_EPSILON) * CONSTANTS_ONE_G;
return limit;
}