66 Commits

Author SHA1 Message Date
Silvan Fuhrer
91ab09ebd5 TECS: in _calcPitchControlOutput guard against invalid airspeed inputs
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-12 15:16:38 +01:00
Silvan Fuhrer
9db86f7f0a TECS: fix airspeed filter init in airspeed-less mode
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-12 15:16:38 +01:00
Silvan Fuhrer
60e2c6a5cb TECS: improve initialization
-remove external init, and instead always (but only) init when dt is too large
-init the controller params correctly

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-12 15:16:38 +01:00
Silvan Fuhrer
7926107328 TECS: make sure to constrain pitch to current min/max pitch
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-12 15:16:38 +01:00
Silvan Fuhrer
cc743048ba TECS: set _ratio_underspeed to 0 if airspeed disabled
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-12 15:16:38 +01:00
Roman Bapst
dd2322d622
Added PerformanceModel for fixed wing (#22091)
* created a Performance Model for fixed wing vehicle
- added compensation for maximum climbrate, minimum sinkrate, minimum airspeed and trim airspeed based on weight ratio and air density
- added atmosphere lib to standard atmosphere calculations


---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
Co-authored-by: Thomas Stastny <thomas.stastny@auterion.com>
2023-11-21 17:13:50 +01:00
Silvan Fuhrer
8741a9784d TECS: remove TECS_MODE enum and instead add descriptive boolean flag to tecs_status
New flag: underspeed_mode_enabled.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-11-07 12:18:06 -05:00
Silvan Fuhrer
a6fcf7b48c TECS: remove airspeed adaption in case of underspeed
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-11-07 12:18:06 -05:00
Thomas Stastny
def4ce6ba8 FixedwingPositionControl: slightly simplify manual position control (use navigateLine() to be sure no turnaround)
make notes on odd things that are likely still wrong
2023-09-08 16:08:38 +02:00
Silvan Fuhrer
77d09785f3 TECS: init _velocity_control_traj_generator properly
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-05-15 13:53:32 +02:00
Silvan Fuhrer
8f520ab019
tecs: fix throttle prediction (#21444)
* tecs: fix throttle prediction

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Thomas Stastny <thomas.stastny@auterion.com>
2023-04-06 20:13:32 +02:00
Silvan Fuhrer
460956fd33 TECS: revert altitude controller to old logic
- if the height rate input into TECS is finite, use that one to
update a velocity reference generator
- if the velocity reference generator reports position locked or
height rate input is not finite, then run altidue reference generator
- run altitude controller only if altitue is controlled

if height_rate_setpoint is set, only use that one to update altitdue trajectory

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-04-06 20:12:52 +02:00
Silvan Fuhrer
60cd20c19c TECS: make more readable
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-04-06 20:12:52 +02:00
Silvan Fuhrer
2d01cf63ce TECS: rename _reference_model to _altitude_reference_model
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-04-06 20:12:52 +02:00
Silvan Fuhrer
beeae1f673 TECS: rename TECSReferenceModel to TECSAltitudeReferenceModel
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-04-06 20:12:52 +02:00
Silvan Fuhrer
1f5046f165
FWPositionControl: trim throttle prediction improvements (#21345)
* FWPositionController: add linear airspeed-to-trim-throttle mapping

Scale trim throttle in a linear way with airspeed.
Different gradients above/below trim airspeed.

The airspeed- and airs density-corrected trim throttle is required for an accurate
throttle prediction in TECS, while the default trim throttle is still needed
as well, as the throttle delta from height rate setpoint delta is linked to it.

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-04-06 11:56:54 +02:00
Silvan Fuhrer
28db47480d TECS: remove ununsed getSteRate()
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-16 16:58:08 +01:00
Silvan Fuhrer
76116d79f9 TECS: remove umcommanded_descent flag
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-01 10:39:09 +01:00
Silvan Fuhrer
837095b9a8
tecs: use FW_T_SINK_MIN for STE_rate_min (#21190)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-24 15:46:41 +01:00
Silvan Fuhrer
88ec117e59 TECS: rename tecs_status.altitude_filtered to altitude_sp_ref
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-26 17:04:43 +01:00
Silvan Fuhrer
5099a91f87 TECS: keep _pitch_integ_state in radians
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-26 17:04:43 +01:00
Silvan Fuhrer
e16f98c2b6 FW Position controller: remove unused climbout arguments
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-26 17:04:43 +01:00
KonradRudin
d3b7112dd9
[TECS]: If in airspeedless mode, add the throttle integrator term to the throttle setpoint, if the integrator term is positive. This should avoid reducing airspeed when switching to airspeedless mode. (#20987) 2023-01-25 09:16:11 +01:00
Konrad
f5524fa605 TECS: Combine both airspeed and airspeed derivative filters in TECS into one MIMO filter using a steady state Kalman filter. 2022-12-21 09:04:19 +01:00
Konrad
08c36612b3 TECS: Updated throttle control for airspeed sensorless vehicles. It includes the P gain controller instead of feedforward only. I term is still disabled. 2022-12-21 09:04:19 +01:00
Konrad
77539d4dac TECS: Rearrange setpoint input. If an altitude rate is given, use this as a feedforward term in the altitude control. If an altitude setpoint is given use a reference model to get a smooth altitude setpoint. 2022-12-21 09:04:19 +01:00
Konrad
8c6dfc840b TECS: Fix bug to reset airspeed derivative and energy rate low pass filters at every time step. 2022-12-21 09:04:19 +01:00
Konrad
7a3e0f53c2 TECS: Replaced old tecs by cleaned up version. 2022-12-21 09:04:19 +01:00
Konrad
991689d3cd TECS: Add new tecs library in parallel to old tecs in the position control library for comparison. 2022-12-21 09:04:19 +01:00
Silvan Fuhrer
d8e483ae20 TECS: guard against NAN airspeed setpoints
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-21 09:51:38 +02:00
Thomas Stastny
a12e40b1d8 tecs: convert tas error and soft bounds to percentage of trim airspeed 2022-07-18 10:49:27 -04:00
Thomas Stastny
1782f9cd3e tecs: zero guard ste rates and airspeed setpoint rates 2022-07-18 10:49:27 -04:00
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