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>
This commit is contained in:
RomanBapst
2021-05-03 17:41:27 +03:00
committed by Silvan Fuhrer
parent 4b7416c05b
commit a5cc449e69
4 changed files with 41 additions and 69 deletions
@@ -386,7 +386,7 @@ FixedwingPositionControl::tecs_status_publish()
break;
}
t.altitude_sp = _tecs.hgt_setpoint_adj();
t.altitude_sp = _tecs.hgt_setpoint();
t.altitude_filtered = _tecs.vert_pos_state();
t.true_airspeed_sp = _tecs.TAS_setpoint_adj();
@@ -1947,7 +1947,8 @@ FixedwingPositionControl::tecs_update_pitch_throttle(const hrt_abstime &now, flo
climbout_pitch_min_rad - radians(_param_fw_psp_off.get()),
throttle_min, throttle_max, throttle_cruise,
pitch_min_rad - radians(_param_fw_psp_off.get()),
pitch_max_rad - radians(_param_fw_psp_off.get()));
pitch_max_rad - radians(_param_fw_psp_off.get()),
_param_climbrate_target.get(), _param_sinkrate_target.get());
tecs_status_publish();
}