fix(tecs): low-pass the throttle energy rate error, not the estimate

The throttle feedback compared an unfiltered total energy rate setpoint
with an estimate low-passed by FW_T_STE_R_TC. On a setpoint change the
lag between the two showed up as a phantom error that the proportional
and integral paths acted on, pushing the throttle beyond what the
feedforward already demanded. Filter the error instead: setpoint and
estimate then see the same lag and only true tracking errors reach the
feedback, while the feedforward keeps acting on the unfiltered setpoint.

The airspeed-less altitude step test no longer needs to disable the
filter: on the step up the phantom error sped the vehicle up by 3 cm/s,
beyond the test's airspeed tolerance, and now it stays within it.

Assisted-by: Claude Fable 5.1
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
Balduin authored and RomanBapst committed 2026-11-20 09:25:13 +03:00
1 parent 98cb30bf47
commit 418b3a4d8a
3 files changed
+13 -14

No files matched your search

+1 -3
View File
@@ -591,14 +591,12 @@ TEST_F(TECSControlClosedLoopTest, AirspeedlessSteadyStateCruise)
// SEB_rate_sp / (V * g) asks for twice the demanded climb angle. A feedforward gain of 0.5 cancels this: the vehicle
// then flies exactly the demanded climb rate, the SEB rate error stays zero, and the altitude error decays first order
// with FW_T_ALT_TC. As in AltitudeStepDown, the pitch must follow the raw step as fast as the throttle and the demanded
// sink rate must not exceed FW_T_SINK_MIN. The total energy rate filter (FW_T_STE_R_TC) is disabled, as its lag
// makes the throttle damping briefly overfund the climb on the step up and speed the vehicle up.
// sink rate must not exceed FW_T_SINK_MIN.
TEST_F(TECSControlClosedLoopTest, AirspeedlessAltitudeStepHalfFeedforward)
{
disableAirspeed();
_params.seb_rate_ff = 0.5f;
_params.ste_rate_time_const = 0.f;
run(10.f);