34 Commits

Author SHA1 Message Date
Thomas Stastny
73010cc69b TECS: speed (only) -based underspeed detection
- underspeed condition only determined by true airspeed undershoot
- change binary underspeed condition to a continuous percent undersped
- ramp-in max throttle, pitch speed weight, and TAS setpoint reduction during underspeed to avoid jumpy commands at the true airspeed error boundary
- let true airspeed filter reach zero airspeed
2022-07-18 10:49:27 -04:00
Thomas Stastny
eed073887d remove in air vs landed knowledge from TECS
- create integral and trajectory generator reset methods
- always run TECS unless in rotary-wing mode (or in transition)
- constantly reset TECS integrals and trajectory generators when landed
2022-07-18 10:49:27 -04:00
RomanBapst
92cdff6798 TECS: rename airspeed/throttle "cruise" to "trim"
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-07-12 09:07:20 +02:00
RomanBapst
b57d3c6d74 TECS: set true airspeed rate setpoint to zero if airspeed is not enabled
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-07-12 09:07:20 +02:00
RomanBapst
56cf77a74c addressed review comments
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
Roman Bapst
d58d13b2e8 APX4-1617: Fix manual climb rate in TECS (#1463)
* tecs: workaround for the fact that vel smoothing lib uses a DOWN coordinate system

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
RomanBapst
924298e9c3 addressed review comments
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
RomanBapst
0ac3077bdc tecs: use trajectory generation library to compute height rate setpoint
- added ability to specify maximum acceleration constraint for height rate setpoint
- added support for locking altitude setpoint when in height rate control
mode and height rate input is zero

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
Daniel Agar
883624d915 lib/geo: move from ecl 2021-07-15 10:38:24 -04:00
RomanBapst
ad9288536b TECS: enable direct height-rate control
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-06-04 14:51:27 +02:00
RomanBapst
a5cc449e69 tecs: propagate altitude setpoint based on target climb/sink rate
- avoids tecs always climbing and sinking and max rates and allows to fine tune these rates
- avoid numerical calculation of feedforward velocity using derivative, this
 was prone to jitter in dt

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-06-04 14:51:27 +02:00
RomanBapst
b06b46b224 log raw airspeed derivative, pitch setpoint and airspeed innovation for TECS
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-05-31 23:56:23 +02:00
Silvan Fuhrer
4b42a1639b TECS: in airspeed-less mode, set airspeed estimate to cruise airspeed
In airspeed-less mode, instead of the average of min/max airspeed, take the cruise
airspeed (from param) for current airspeed estimate. A diff of the airspeed setpoint
from this value results in increased enegery demand (incerase of throttle) even
in airspeed-less mode.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-05-28 14:25:53 +02:00
RomanBapst
b66ae5f2d4 tecs: use raw inertial acceleration for true airspeed complementary filter
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-03-31 20:12:40 -04:00
RomanBapst
82a2126f97 TECS: add feedforward gain for total energy balance rate
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-03-15 11:47:07 -04:00
CarlOlsson
b4b424bf7d tecs: also fix the bug in update_vehicle_state_estimates() 2021-03-05 19:44:20 +01:00
CarlOlsson
0f461f7f60 TECS: Fix internal state init if dt is large 2021-03-05 19:44:20 +01:00
Daniel Agar
cb7aabf932 fw_pos_control_l1: cleanup body velocity and acceleration usage
- minimize storing unnecessary state (msg copies)
2021-02-12 00:41:39 +01:00
Silvan Fuhrer
5e32e9be5a TECS: rename variables and methods to make clear which are EAS and which TAS
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-23 09:34:34 -05:00
RomanBapst
f05599caff tecs: use speed derivative provided by local position
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst
e546584555 tecs: moved trivial getter methods to header file
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
Roman Bapst
701c105ab6 Update src/lib/tecs/TECS.cpp
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst
fa559aef43 TECS: stop learing integrator if airspeed is not available, but don't zero it
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst
d4d1c0fe01 TECS: some cosmetics
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst
97cc1e25dd TECS: hande pitch and throttle integrator saturation consistently
- don't decay integrator during saturation but prevent it from being learned
into the direction which causes more actuator saturation

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst
77627a08ca TECS: don't allow speed height weights to be larger than one
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
Silvan Fuhrer
3102b9f071 TECS: remove throttle integral limits
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-13 21:21:07 +03:00
RomanBapst
5c4c2c240c tecs: dot not clip throttle integrator during saturation but only allow
it to propagate into a direction which does not saturate

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
Silvan Fuhrer
2ca4269464 TECS: separate integral gains for throttle and pitch loops
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-13 21:21:07 +03:00
RomanBapst
01f891618b TECS: move to new control loop architecture
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst
447e14906c TECS: log more TECS states to enable better analysis
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst
8823f5e1ec TECS: added method to get SKE weighting
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
RomanBapst
d0e8b882a2 TECS: added alpha filter classes to energy rate and tas derivative
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-13 21:21:07 +03:00
Daniel Agar
87250ca47f move ecl L1, TECS, and data validator to PX4/Firmware 2020-06-18 19:26:30 -04:00