iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.09k stars 1.46k forks source link

Dual elevon/crow flap support for fx-79 buffalo flying wing - Feature Request #3856

Closed jgilbertfpv closed 5 years ago

jgilbertfpv commented 6 years ago

Current Behavior

Flying wing has two elevons per side

Desired Behavior

Could another mode similar to flaperons be added that would work on elevons, so that the inner elevons drop, and outer elevons go up to work as crow braking? maybe also controlled by rudder input to make one side at a time crow as well.

Suggested Solution

I'm not sure how similar code is for inav to ardupilot but i've managed to edit a mix in ardupilot code that might help explain a bit better. /* Differential spoilers are a type of elevon that is split on each wing to give yaw control, mixed from rudder

` void Plane::dspoiler_update(void) { // just check we have a left dspoiler, and if so calculate all outputs if (!SRV_Channels::function_assigned(SRV_Channel::k_dspoilerLeft1)) { return; } float elevon_left = SRV_Channels::get_output_scaled(SRV_Channel::k_elevon_left); float elevon_right = SRV_Channels::get_output_scaled(SRV_Channel::k_elevon_right); float rudder_rate = g.dspoiler_rud_rate 0.01f; float rudder = SRV_Channels::get_output_scaled(SRV_Channel::k_rudder) rudder_rate; float dspoiler1_left = elevon_left; float dspoiler2_left = elevon_left; float dspoiler1_right = elevon_right; float dspoiler2_right = elevon_right; RC_Channel *flapin = RC_Channels::rc_channel(g.flapin_channel-1); int8_t flap_percent = flapin->percent_input();;

if (rudder > 0) {
    // apply rudder to right wing
    dspoiler1_right = constrain_float(elevon_right + rudder, -4500, 4500);
    dspoiler2_right = constrain_float(elevon_right - rudder, -4500, 4500);
} else {
    // apply rudder to left wing
    dspoiler1_left = constrain_float(elevon_left - rudder, -4500, 4500);
    dspoiler2_left = constrain_float(elevon_left + rudder, -4500, 4500);
}
if (flap_percent > 0) {
    //apply crow brakes to both wings
    dspoiler1_right = constrain_float(elevon_right + flap_percent * 25, -4500, 4500);
    dspoiler2_right = constrain_float(elevon_right - flap_percent * 45, -4500, 4500); 
    dspoiler1_left = constrain_float(elevon_left + flap_percent * 25, -4500, 4500);
    dspoiler2_left = constrain_float(elevon_left - flap_percent * 45, -4500, 4500);
}
SRV_Channels::set_output_scaled(SRV_Channel::k_dspoilerLeft1, dspoiler1_left);
SRV_Channels::set_output_scaled(SRV_Channel::k_dspoilerLeft2, dspoiler2_left);
SRV_Channels::set_output_scaled(SRV_Channel::k_dspoilerRight1, dspoiler1_right);
SRV_Channels::set_output_scaled(SRV_Channel::k_dspoilerRight2, dspoiler2_right);

} `

Who does this impact? Who is this for?

This would work for flying wings with two elevons per side such as the fx-79 buffalo

Additional context

here's a clip showing crow braking on a fx-79 https://www.youtube.com/watch?v=qQI_1P7voCg

DzikuVx commented 5 years ago

You can do it with the mixer already. Just assign new servos, mix correct inputs and set lower rates (or higher)