Calculating Elevon Motion
There are two calculations, one for each elevon:
There are two calculations, one for each elevon:
a = x/2 - y/2
b = x/2 + y/2
- a = left elevon deflection,
- b = right elevon deflection,
- x = aileron position (-1 = far left, 0 = centered, 1 = far right),
- y = elevator position (likewise, -1 .. 1)
Deriving the Elevon Calculation
I couldn't find the above formula anywhere on the web, probably because it's so obvious to everybody but me. Here's how I figured it out. Real mathematicians would do it much easier I'm sure!
First, look at the inputs and outputs. The above video shows the endpoints and midpoints of the two axes.
which gives us this table for the values of A and B:
a,b = f(x,y):
x=-1.0 x=0.0 x=1.0
y=1.0 -1.0, 0.0 -0.5, -0.5 0.0, -1.0
y=0.0 -0.5, 0.5 0.0, 0.0 0.5, -0.5
y=-1.0 0.0, 1.0 0.5, 0.5 1.0, 0.0
x=-1.0 x=0.0 x=1.0
y=1.0 -1.0, 0.0 -0.5, -0.5 0.0, -1.0
y=0.0 -0.5, 0.5 0.0, 0.0 0.5, -0.5
y=-1.0 0.0, 1.0 0.5, 0.5 1.0, 0.0
Showing only the values for A, we notice that there's a pattern across the rows, namely that it increments by .5 each row, as X varies from -1 to 1. So, we can start with "+ x/2" for each of the rows, for some value of Y.
a = f(x,y):
-1.0 -0.5 0.0
-0.5 0.0 0.5
0.0 0.5 1.0
-1.0 -0.5 0.0
-0.5 0.0 0.5
0.0 0.5 1.0
Likewise, we can see the same pattern for the columns in the other direction. Fiddling a bit, I came up with -y/2 + x/2 which of course simplifies to x/2 - y/2. I guessed there was a similar pattern for B, and tried a few variations of adding and subtracting x/2 and y/2. until I confirmed that x/2 + y/2 worked.
Here's a bit of python that reproduces the table above:
for x in (-1.0, 0.0, 1.0):
for y in (1.0, 0.0, -1.0):
a = x/2 - y/2
b = x/2 + y/2
print a,
print b,'\t\t',
print
for y in (1.0, 0.0, -1.0):
a = x/2 - y/2
b = x/2 + y/2
print a,
print b,'\t\t',
Thanks for the equation =)
ReplyDelete