Skip to content

Commit

Permalink
add setting to differentiate front and back wing
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoudSmeur authored and dewagter committed Sep 8, 2023
1 parent 33a45dc commit 964383f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions conf/modules/eff_scheduling_nederdrone.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ not use this module at the same time!</description>
<dl_setting shortname="tip_prop_upper_pitch" var="sched_tip_prop_upper_pitch_limit_deg" min="-90" step="1" max="0"/>
<dl_setting shortname="sched_ratio_tip_props" var="sched_ratio_tip_props" min="0" step="0.1" max="1"/>
<dl_setting shortname="thrust_eff_scaling" var="thrust_eff_scaling" min="0.6" step="0.01" max="1.4"/>
<dl_setting shortname="back_eff_scaling" var="backwing_thrust_eff_scaling" min="0.6" step="0.01" max="1.4"/>
<dl_setting shortname="all_act_fwd_sched" var="all_act_fwd_sched" min="0" step="1" max="1" values="OFF|ON"/>
<dl_setting shortname="trim_elevator" var="trim_elevator" min="-5000" step="1" max="5000"/>
<dl_setting shortname="trim_flaps" var="trim_flaps" min="-5000" step="1" max="5000"/>
Expand Down
4 changes: 4 additions & 0 deletions sw/airborne/modules/ctrl/eff_scheduling_nederdrone.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ bool all_act_fwd_sched = false;
int32_t use_scheduling = 1;

float thrust_eff_scaling = 1.0;
float backwing_thrust_eff_scaling = 1.0;

static float g_forward[4][INDI_NUM_ACT] = {STABILIZATION_INDI_G1_ROLL_FWD, STABILIZATION_INDI_G1_PITCH_FWD, STABILIZATION_INDI_G1_YAW_FWD, STABILIZATION_INDI_G1_THRUST_FWD};

Expand Down Expand Up @@ -196,6 +197,9 @@ void schdule_control_effectiveness(void) {
// Thrust
g1g2[3][i] = g_hover[3][i] * (1.0 - ratio_spec_force) + g_forward[3][i] * ratio_spec_force;
g1g2[3][i] *= thrust_eff_scaling;
if( (i ==2) || (i==3)) {
g1g2[3][i] *= backwing_thrust_eff_scaling;
}
}

bool low_airspeed = stateGetAirspeed_f() < INDI_SCHEDULING_LOW_AIRSPEED;
Expand Down
1 change: 1 addition & 0 deletions sw/airborne/modules/ctrl/eff_scheduling_nederdrone.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ extern float sched_tip_prop_lower_pitch_limit_deg;
extern bool sched_tip_props_always_on;
// Setting to scale the thrust effectiveness
extern float thrust_eff_scaling;
extern float backwing_thrust_eff_scaling;

// Schedule all forward actuators with airspeed instead of only the flaps
extern bool all_act_fwd_sched;
Expand Down

0 comments on commit 964383f

Please sign in to comment.