
1/4/2015:  ArduPlane V3.2.0_etMod  "Fixed differential spoilers support, added elevon offset"

Branch name:  etMod_DiffSpoilersFix_MixOffs

Description:  Fixed differential spoilers support; implemented new MIXING_OFFSET and DSPOILR_RUD_RATE parameters.

Fixes ArduPlane differential spoilers when ELEVON_MIXING=0 and ELEVON_OUTPUT>0 (mixing done in flight controller).  All flight modes are supported.  This functionality is used on flying wings with "split elevons" using two servos on each side.  In v3.2 of ArduPlane, differential spoilers are non-operational.  This patch fixes them so they operate as described in the ArduPlane docs:  http://plane.ardupilot.com/wiki/differential-spoilers

Added parameter:  DSPOILR_RUD_RATE  "Differential spoilers rudder rate"
Sets the amount of deflection that the rudder output will apply to the differential spoilers, as a percentage. The default value of 100 results in full rudder applying full deflection. A value of 0 will result in the differential spoilers exactly following the elevons (no rudder effect).

Added parameter:  MIXING_OFFSET
The offset for the Vtail and elevon output mixers, as a percentage. This can be used in combination with MIXING_GAIN to configure how the control surfaces respond to input. The response to aileron or elevator input can be increased by setting this parameter to a positive or negative value. A common usage is to enter a positive value to increase the aileron response of the elevons of a flying wing. The default value of zero will leave the aileron-input response equal to the elevator-input response.

Notes:  The new parameter DSPOILR_RUD_RATE allows the rudder effect to be "toned down."  Otherwise it can be too easy to apply too much rudder-spoiler control and stall the wing.  The new parameter MIXING_OFFSET allows the elevon mixing on a wing to be tuned so that the "aileron" effect is greater than the "elevator" effect.  Flying wings are usually pitch-sensitive while being difficult to roll, so this tuning is desirable.  I have successfully tested this patch (applied to ArduPlane v3.2) in a 47" Popwing, in Manual, Stabilized, and GPS-guided flight modes.


----------------------------------------------------------------------------


Files modified (under 'ArduPlane'):

Attitude.pde:  Fixed differential spoilers support; implemented new MIXING_OFFSET and DSPOILR_RUD_RATE parameters.
config.h:  Added DSPOILR_RUD_RATE_DEFAULT.
Parameters.h:  Added 'k_param_mixing_offset', 'k_param_dspoiler_rud_rate', 'mixing_offset' and 'dspoiler_rud_rate'.
Parameters.pde:  Added MIXING_OFFSET and DSPOILR_RUD_RATE.


----------------------------------------------------------------------------


        k_param_mixing_offset,
        k_param_dspoiler_rud_rate,

    // @Param: MIXING_OFFSET
    // @DisplayName: Mixing Offset
    // @Description: The offset for the Vtail and elevon output mixers, as a percentage. This can be used in combination with MIXING_GAIN to configure how the control surfaces respond to input. The response to aileron or elevator input can be increased by setting this parameter to a positive or negative value. A common usage is to enter a positive value to increase the aileron response of the elevons of a flying wing. The default value of zero will leave the aileron-input response equal to the elevator-input response.
    // @Units: percent
    // @Range: -1000 1000
    // @User: User
    GSCALAR(mixing_offset,          "MIXING_OFFSET",  0),

    // @Param: DSPOILR_RUD_RATE
    // @DisplayName: Differential spoilers rudder rate
    // @Description: Sets the amount of deflection that the rudder output will apply to the differential spoilers, as a percentage. The default value of 100 results in full rudder applying full deflection. A value of 0 will result in the differential spoilers exactly following the elevons (no rudder effect).
    // @Units: percent
    // @Range: -1000 1000
    // @User: User
    GSCALAR(dspoiler_rud_rate,      "DSPOILR_RUD_RATE",  DSPOILR_RUD_RATE_DEFAULT),


----------------------------------------------------------------------------


Plane: differential spoiler doesn't work #1032
https://github.com/diydrones/ardupilot/issues/1032
http://ardupilot.com/forum/viewtopic.php?f=98&t=7400
http://diydrones.com/forum/topics/differential-spoilers-and-elevon-output
http://diydrones.com/group/x8/forum/topics/differential-spoilers-on-x8
