Profile image

Practical Elevons with XML hacking

117 Sleet01  3.8 years ago

I wasn't able to find any good examples of this method of mixing elevators and ailerons without using hinges or other hacks, so here's my method:

  1. Read the latest docs.
  2. Install/activate the Overload mod (Windows, Mac, Android) or find another way to edit your XML files (iOS).
  3. Build a plane which will need elevons; usually this will be a delta or flying wing configuration.
  4. Add one control surface to each wing. You will probably want this to be close to full span for a delta wing, but for heavily swept flying wings the elevons should be about 1/4 to 1/2 span, at the tip furthest back from the Center of Gravity of the plane (Cg).
  5. Edit the XML for each wing:

    • Right wing: ControlSurface: "inputID" = "((Roll - Pitch) / 2)"

    • Left wing: ControlSurface: "inputID" = "((Roll + Pitch) / 2)"

  6. Fly!

Notes:
- The operator is reversed between left and right wings because SimplePlanes is reversing one of the inputs behind the scenes for one of the wings.
- This mixing function is pretty simple: add the values of the Roll and Pitch inputs (both are [1, 0, -1] inclusive) and then halve the total so that the absolute value of the effective input never exceeds 1. This means that the effective Roll and Pitch inputs are each 1/2 of normal, but since you're using larger control surfaces this shouldn't be much of an issue.

I also tried a normalized mixing function:

inputId = ((Roll - Pitch) / (max(1, abs(Roll) + abs(Pitch))))

which gives full control authority when using only Roll or only Pitch, but prevents exceeding 1 when e.g. Roll is 0.75 and Pitch is 0.75. I found this to be too sensitive but it could be useful for e.g. dogfighters.

Example craft using my elevon mixing functions can be found here:
Dobson Convertiplane Prototype 7

  • Log in to leave a comment
  • Profile image
    3,214 Chrisk1993

    Thank you I've been trying to work out v tail mixing. Will have to look into more advanced XML stuff.

    +2 3.5 years ago
  • Profile image
    41.7k rexzion

    hacker

    +1 3.8 years ago
  • Profile image
    117 Sleet01

    @WNP78 Good point, although I did have to manually enable it from the Mods menu.

    3.8 years ago
  • Profile image
    Dev WNP78

    No need to download and install Overload, it should be bundled with the latest version of the game on all platforms.

    +4 3.8 years ago