Skip to content

Commit

Permalink
fw_tecs: Support tighter altitude tracking during low-height flight (P…
Browse files Browse the repository at this point in the history
…X4#23519)

* fw_tecs: Support tighter altitude tracking during low-height flight. Added FW_T_THR_LOW_HGT defining low-height flight threshold

* tecs: Applied smoothed-out altitude TC transition to landings

* fw_tecs: modified tighter altitude control for low-height implementation

* addressed PR comments

* addressed PR comments

---------

Co-authored-by: Silvan Fuhrer <[email protected]>
  • Loading branch information
oravla5 and sfuhrer authored Sep 19, 2024
1 parent 4d83bad commit 2ecffff
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 21 deletions.
1 change: 1 addition & 0 deletions msg/TecsStatus.msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ uint64 timestamp # time since system start (microseconds)

float32 altitude_sp # Altitude setpoint AMSL [m]
float32 altitude_reference # Altitude setpoint reference AMSL [m]
float32 altitude_time_constant # Time constant of the altitude tracker [s]
float32 height_rate_reference # Height rate setpoint reference [m/s]
float32 height_rate_direct # Direct height rate setpoint from velocity reference generator [m/s]
float32 height_rate_setpoint # Height rate setpoint [m/s]
Expand Down
8 changes: 8 additions & 0 deletions src/lib/tecs/TECS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,14 @@ class TECS
float get_pitch_setpoint() {return _control.getPitchSetpoint();}
float get_throttle_setpoint() {return _control.getThrottleSetpoint();}

/**
* Returns the altitude tracking time constant
*/
float get_altitude_error_time_constant() const
{
return 1.0f / math::max(_control_param.altitude_error_gain, 0.01f);
}

uint64_t timestamp() { return _update_timestamp; }
float get_underspeed_ratio() { return _control.getRatioUndersped(); }

Expand Down
Loading

0 comments on commit 2ecffff

Please sign in to comment.