From edec706c1237cc4f2fda6c798a7a50f1eaea24de Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 16 Apr 2015 11:16:30 +1000 Subject: [PATCH] Plane: added RUDDER_ONLY parameter this gives much easier setup for rudder only aircraft. --- ArduPlane/Attitude.pde | 4 +++- ArduPlane/Parameters.h | 2 ++ ArduPlane/Parameters.pde | 7 +++++++ ArduPlane/failsafe.pde | 4 +++- ArduPlane/radio.pde | 6 +++++- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ArduPlane/Attitude.pde b/ArduPlane/Attitude.pde index f8c0eaf588..c757b202b4 100644 --- a/ArduPlane/Attitude.pde +++ b/ArduPlane/Attitude.pde @@ -968,7 +968,9 @@ static void set_servos(void) // send values to the PWM timers for output // ---------------------------------------- - channel_roll->output(); + if (g.rudder_only == 0) { + channel_roll->output(); + } channel_pitch->output(); channel_throttle->output(); channel_rudder->output(); diff --git a/ArduPlane/Parameters.h b/ArduPlane/Parameters.h index f5c92753a3..6e99f5b1a9 100644 --- a/ArduPlane/Parameters.h +++ b/ArduPlane/Parameters.h @@ -136,6 +136,7 @@ public: k_param_hil_mode, k_param_land_disarm_delay, k_param_glide_slope_threshold, + k_param_rudder_only, // 100: Arming parameters k_param_arming = 100, @@ -428,6 +429,7 @@ public: AP_Int8 mix_mode; AP_Int8 vtail_output; AP_Int8 elevon_output; + AP_Int8 rudder_only; AP_Float mixing_gain; AP_Int8 reverse_elevons; AP_Int8 reverse_ch1_elevon; diff --git a/ArduPlane/Parameters.pde b/ArduPlane/Parameters.pde index 4921121eb8..1d114c1fc0 100644 --- a/ArduPlane/Parameters.pde +++ b/ArduPlane/Parameters.pde @@ -757,6 +757,13 @@ const AP_Param::Info var_info[] PROGMEM = { // @User: User GSCALAR(mixing_gain, "MIXING_GAIN", 0.5f), + // @Param: RUDDER_ONLY + // @DisplayName: Rudder only aircraft + // @Description: Enable rudder only mode. The rudder will control attitude in attitude controlled modes (such as FBWA). You should setup your transmitter to send roll stick inputs to the RCMAP_YAW channel (normally channel 4). The rudder servo should be attached to the RCMAP_YAW channel as well. Note that automatic ground steering will be disabled for rudder only aircraft. You should also set KFF_RDDRMIX to 1.0. You will also need to setup the YAW2SRV_DAMP yaw damping appropriately for your aircraft. A value of 0.5 for YAW2SRV_DAMP is a good starting point. + // @Values: 0:Disabled,1:Enabled + // @User: User + GSCALAR(rudder_only, "RUDDER_ONLY", 0), + // @Param: SYS_NUM_RESETS // @DisplayName: Num Resets // @Description: Number of APM board resets diff --git a/ArduPlane/failsafe.pde b/ArduPlane/failsafe.pde index c9093819a5..19787edc39 100644 --- a/ArduPlane/failsafe.pde +++ b/ArduPlane/failsafe.pde @@ -90,7 +90,9 @@ void failsafe_check(void) channel_pitch->output(); } channel_throttle->output(); - channel_rudder->output(); + if (g.rudder_only == 0) { + channel_rudder->output(); + } // setup secondary output channels that do have // corresponding input channels diff --git a/ArduPlane/radio.pde b/ArduPlane/radio.pde index 6bac62e5f0..cfb11460a5 100644 --- a/ArduPlane/radio.pde +++ b/ArduPlane/radio.pde @@ -8,7 +8,11 @@ */ static void set_control_channels(void) { - channel_roll = RC_Channel::rc_channel(rcmap.roll()-1); + if (g.rudder_only) { + channel_roll = RC_Channel::rc_channel(rcmap.yaw()-1); + } else { + channel_roll = RC_Channel::rc_channel(rcmap.roll()-1); + } channel_pitch = RC_Channel::rc_channel(rcmap.pitch()-1); channel_throttle = RC_Channel::rc_channel(rcmap.throttle()-1); channel_rudder = RC_Channel::rc_channel(rcmap.yaw()-1);