Commit Graph
4 Commits
Author SHA1 Message Date
Balduin 418b3a4d8a 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>
2026-11-20 09:25:13 +03:00
Balduin 98cb30bf47 test(tecs): standardise step sizes
Use one altitude and one airspeed step size for all step tests, so the
tests are easier to compare:
 - ALT_STEP chosen to not saturate throttle while sinking or climbing
     - Altitude step up test added (disabled, see comment)
 - AIRSPEED_STEP = 1 m/s
     - Only effective change is gliding (previously 2 m/s steps)
 - FastDescend drops the altitude setpoint, which does not affect it, and
   checks the throttle is exactly at its minimum

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Balduin <balduin@auterion.com>
2026-11-20 06:33:50 +03:00
Balduin 4d77b71c72 test(tecs): clean up logging & variable names
Stop mixing up previous and current steps:
 - _pitch and _throttle hold the last TECS command, which the plant
   applies until the next update (drop the _prev naming)
 - reorder logging, so each row pairs a state with the command
   computed from it:
     - find control input
     - sim stats, csv output
     - advance simulation

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Balduin <balduin@auterion.com>
2026-11-20 06:33:50 +03:00
Balduin b35a34efb1 test(tecs): rename the closed-loop test to TECSControlClosedLoopTest
The test drives TECSControl, not the outer TECS class, so name it after
the class under test like TECSTest.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Balduin <balduin@auterion.com>
2026-11-20 06:33:50 +03:00