heightrate p as parameter

This commit is contained in:
Thomas Gubler
2013-10-31 14:20:30 +01:00
parent 2e9a383390
commit c0100b5e17
4 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -231,7 +231,7 @@ void TECS::_update_height_demand(float demand, float state)
_hgt_dem_adj = demand;//0.025f * demand + 0.975f * _hgt_dem_adj_last;
_hgt_dem_adj_last = _hgt_dem_adj;
_hgt_rate_dem = (_hgt_dem_adj-state)*0.1f; //xxx: parameter
_hgt_rate_dem = (_hgt_dem_adj-state)*_heightrate_p;
// Limit height rate of change
if (_hgt_rate_dem > _maxClimbRate) {
_hgt_rate_dem = _maxClimbRate;
+5
View File
@@ -178,6 +178,10 @@ public:
_indicated_airspeed_max = airspeed;
}
void set_heightrate_p(float heightrate_p) {
_heightrate_p = heightrate_p;
}
private:
// Last time update_50Hz was called
uint64_t _update_50hz_last_usec;
@@ -201,6 +205,7 @@ private:
float _vertAccLim;
float _rollComp;
float _spdWeight;
float _heightrate_p;
// throttle demand in the range from 0.0 to 1.0
float _throttle_dem;