V-Tail Mixing in firmware

Hi Droners.  I've implemented V-tail mixing support in ArduPlane 2.68.  I chose 2.68 rather than 2.70 as I am not using the PX4 board.  Previously, if you were using a V-Tail model you have to use an external V-tail mixer.  If you've tried an external V-tail mixer you will know they can be laggy and sometimes unreliable.  Hence, I roll up a first pass of the V-tail firmware. 

 

At present it's implemented as a couple of pre-processor directives that you set in APM_Config.h.  I'd like to make it more future-proof by making it a config parameter that can be tuned via the MissionPlanner.  However, I'd like to get it out so that other people who might want to use V-Tail mixing can test it. 

 

To implement it, I de-mix the V-tail mixing in the read_radio() function and re-mix it in the set_servos() function.  This means that internally, the APM thinks you have a regular elevator/rudder tail.  It also means that if the APM should crash, the PPM hardware should pass your signal through to the servos. 

I've flown it in one model, 3 flights.  It performed flawlessly in MANUAL, STABILIZE, FBW_A and RTL modes, the only modes I used.  However, it would be great if more people can test and extend the V-tail mixing.  I have one more V-tail model I'm repairing and will remove the V-Tail mixer and use this new firmware. 

 

To test it, please apply the provided patch (VEE_TAIL.patch) to ArduPlane 2.68: 

cd ArduPlane-2.68/ArduPlane

patch -u < ../../SourceCode-ArduPlane2.68/Vee-Tail-0.1.patch

 If you are uncomfortable using the patch command, I've included a .zip file of the modified files.  Unzip these into a clean ArduPlane-2.68/ArduPlane directory and you should be able to compile V-Tail mixing.  If you use the patch, V-Tail mixing will be enabled in your APM_Config.h.  It's not enabled if you use the .zip file, to avoid overwriting whatever configuration you've already set. 

Instructions for use are in APM_Config.h.reference (and copied below).  Going forward, I'd like to see this pushed upstream to the main codebase.  In the mean time, let's test it a bit more.  

//////////////////////////////////////////////////////////////////////////////
// VEE_TAIL_INPUT                       OPTIONAL
// VEE_TAIL_OUTPUT                      OPTIONAL
// VEE_TAIL_REVERSE_YAW                 OPTIONAL
// VEE_TAIL_PITCH_SERVOS_OPPOSITE       OPTIONAL
//
// V-Tail mixing options.
// *NOTE*: do not confuse with elevon mixing (set with g.mix_mode), which is sometimes called V-tail mixing on the forums and knowledge base.
// Set any of these options to ENABLED to enable them.
//
// Enable VEE_TAIL_INPUT to de-mix V-Tail mixing, as programmed in your RC radio.
// This enables the AP software to interpret the 2-channel V-tail mixing as separate elevator and rudder channels.
//#define VEE_TAIL_INPUT                   ENABLED
//
// Enable VEE_TAIL_OUTPUT to re-mix V-Tail mixing.
// Usually VEE_TAIL_INPUT and VEE_TAIL_OUTPUT are enabled together, unless you are testing V-tail mixing.
// In theory, if the APM crashes, the hardware multiplexer should pass through your radio's V-tail mixing as manual control.
//#define VEE_TAIL_OUTPUT                  ENABLED
//
// Enable one, or both of these next two options to get your V-Tail mixing to work the correct direction.
// VEE_TAIL_REVERSE_YAW will reverse the yaw de-mixing (and subsequent re-mixing) direction.
// Set VEE_TAIL_PITCH_SERVOS_OPPOSITE if the tail servos rotate in opposite directions for pitch control.
// Leave it unset if both servos turn in the same direction.  For example:
//
//    ____      ____       FRONT
//  __|__ |     | __|__     /|\
// (o   O |     | O   o)     |  Servos turn opposite for pitch: set
//  ----- |     | -----      |     VEE_TAIL_PITCH_SERVOS_OPPOSITE ENABLED
//    |   |     |   |        |
//    |___|     |___|       \|/
//                          BACK
//    ____      ____       FRONT
//  __|__ |   __|__ |       /|\
// (o   O |  (o   O |        |  Servos turn same for pitch: unset
//  ----- |   ----- |        |  VEE_TAIL_PITCH_SERVOS_OPPOSITE ENABLED
//    |   |     |   |        |
//    |___|     |___|       \|/
//                          BACK
//
// Getting the correct order of these last 2 settings may require some trial and error.  Here is the order of steps I suggest:
// 1) Set up V-tail mixing in your radio, and test it in your model WITHOUT the AMP (just regular control).
// 2) Hook up the APM as recommended in the manual.
// 3) Compile the firmware with VEE_TAIL_INPUT and VEE_TAIL_OUTPUT.
// 4) Test V-tail mixing in APM after it boots up.  Make sure you are in MANUAL mode.
// 5) If yaw and pitch are reversed, set VEE_TAIL_PITCH_SERVOS_OPPOSITE and rebuild.
// 6) If V-tail yaw is reversed, set VEE_TAIL_REVERSE_YAW and rebuild.
// 7) If neither of these changes works, you may need to reverse the tail servos on the OUTPUT side of the APM and go back to step 4.
// 8) Once MANUAL mode is working as expected, try STABILIZE mode.  Pick up the model and pitch up/down to ensure the tailplanes are going the correct direction.
// 9) Good luck, and please post your results on the forum!
//
//#define VEE_TAIL_REVERSE_YAW             ENABLED
//#define VEE_TAIL_PITCH_SERVOS_OPPOSITE   ENABLED

Vee-Tail-0.1.patch

Vee-Tail-0.1.zip

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Great work with the Vtail code. I just installed it and it seems to work well in manual mode and stable.

    Will the Vee-Tail patch work for the new 2.74 release?

    Can you also create a Vee-Tail Zip with the new 2.74 firmware?

    Thanks in advance,

    Rov

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…