From c7c8f29d5660c3f638932f0af711bc97547aef48 Mon Sep 17 00:00:00 2001 From: RomanBapst Date: Wed, 18 Nov 2026 19:32:42 +0300 Subject: [PATCH] test(tecs): explain why the airspeed step down is not first order The step down is not first order because the SEB rate to pitch conversion ignores the total energy rate: the pitch feedforward climbs with the kinetic energy the throttle is already removing, and the pitch integrator takes it out again. The loops interacting is not the cause; with a consistent conversion the response is first order. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: RomanBapst --- src/lib/tecs/TECSClosedLoopTest.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/tecs/TECSClosedLoopTest.cpp b/src/lib/tecs/TECSClosedLoopTest.cpp index 2248077e0aa..9395bc3e9ee 100644 --- a/src/lib/tecs/TECSClosedLoopTest.cpp +++ b/src/lib/tecs/TECSClosedLoopTest.cpp @@ -527,9 +527,10 @@ TEST_F(TECSClosedLoopTest, AirspeedStepDownDefaultTuning) setAirspeedSetpoint(_params.equivalent_airspeed_trim - 1.f); - // Capture the rough shape of the airspeed step response. This one - // is not a nice first order response, because the throttle and pitch - // loop both interact, including the pitch integrator. + // Capture the rough shape of the airspeed step response. It is not first + // order: the SEB rate to pitch conversion ignores the total energy rate, so + // the pitch feedforward climbs with the kinetic energy the throttle is + // already removing, and the pitch integrator has to take it out again. run(5.0f); EXPECT_NEAR(_state.V, _V_sp, 0.3f) << "at t=" << _t << " s"; run(5.0f); EXPECT_NEAR(_state.V, _V_sp, 0.2f) << "at t=" << _t << " s"; run(5.0f); EXPECT_NEAR(_state.V, _V_sp, 0.1f) << "at t=" << _t << " s";