VTOL control back transition ramp up time

This commit is contained in:
sanderux 2017-08-05 11:01:05 +02:00 committed by Sander Smeets
parent 560e9e88dc
commit 50894e8615
3 changed files with 21 additions and 2 deletions

View File

@ -64,6 +64,7 @@ Standard::Standard(VtolAttitudeControl *attc) :
_params_handles_standard.front_trans_dur = param_find("VT_F_TRANS_DUR");
_params_handles_standard.back_trans_dur = param_find("VT_B_TRANS_DUR");
_params_handles_standard.back_trans_ramp = param_find("VT_B_TRANS_RAMP");
_params_handles_standard.pusher_trans = param_find("VT_TRANS_THR");
_params_handles_standard.airspeed_blend = param_find("VT_ARSP_BLEND");
_params_handles_standard.airspeed_trans = param_find("VT_ARSP_TRANS");
@ -97,6 +98,10 @@ Standard::parameters_update()
param_get(_params_handles_standard.back_trans_dur, &v);
_params_standard.back_trans_dur = math::constrain(v, 0.0f, 20.0f);
/* MC ramp up during back transition to mc mode */
param_get(_params_handles_standard.back_trans_ramp, &v);
_params_standard.back_trans_ramp = math::constrain(v, 0.0f, _params_standard.back_trans_dur);
/* target throttle value for pusher motor during the transition to fw mode */
param_get(_params_handles_standard.pusher_trans, &v);
_params_standard.pusher_trans = math::constrain(v, 0.0f, 5.0f);
@ -355,9 +360,9 @@ void Standard::update_transition_state()
}
// continually increase mc attitude control as we transition back to mc mode
if (_params_standard.back_trans_dur > FLT_EPSILON) {
if (_params_standard.back_trans_ramp > FLT_EPSILON) {
float weight = (float)hrt_elapsed_time(&_vtol_schedule.transition_start) /
((_params_standard.back_trans_dur / 2) * 1000000.0f);
((_params_standard.back_trans_ramp) * 1000000.0f);
weight = math::constrain(weight, 0.0f, 1.0f);
_mc_roll_weight = weight;
_mc_pitch_weight = weight;

View File

@ -69,6 +69,7 @@ private:
struct {
float front_trans_dur;
float back_trans_dur;
float back_trans_ramp;
float pusher_trans;
float airspeed_blend;
float airspeed_trans;
@ -86,6 +87,7 @@ private:
struct {
param_t front_trans_dur;
param_t back_trans_dur;
param_t back_trans_ramp;
param_t pusher_trans;
param_t airspeed_blend;
param_t airspeed_trans;

View File

@ -72,3 +72,15 @@ PARAM_DEFINE_FLOAT(VT_DWN_PITCH_MAX, 5.0f);
* @group VTOL Attitude Control
*/
PARAM_DEFINE_FLOAT(VT_FWD_THRUST_SC, 0.0f);
/**
* Back transition MC motor ramp up time
*
* This sets the duration during wich the MC motors ramp up to the commanded thrust during the back transition stage.
*
* @unit s
* @min 0.0
* @max 20.0
* @group VTOL Attitude Control
*/
PARAM_DEFINE_FLOAT(VT_B_TRANS_RAMP, 3.0f);