Aircraft Physics

Hello. I’ve been making a P-51 Mustang D and am trying to get the physics sorted before I do the rest.:eek: Ive got the Lift, Drag and Thrust done. Now I need some realistic but simple flight dynamics for the torque and stall. Also I need some help for calculations of undercarriage drag and flaps drag and lift. Later on I will need a more complicated model for a realistic flight.

Here is an upload. I’ve redone the texture and made it realistic, although some parts have wierd shadows cast on them.

I need help on:

  • Torque Physics
  • A Calulation for RPM, right now I’ve just got it set on the throttle (I need this for the Advance Ratio as it controls the prop efficiency IPO)
  • Undercarriage Drag
  • Flap Drag and Lift
  • How to parent the things together so that Thrust is applied at the front, but the rest of the forces at the centre of gravity

Any help is appreciated. Plz have a detailed look. And most of all, keep this thread going! Usually they die out after a day or two:(.

No help??? :frowning: :frowning: :(. This always happens.

The things you are requesting help on really are quite complicated. That’s why there aren’t many flight sims out there. Because the person trying to make it doesn’t know how, and the people that might be able to help don’t want to get invlolved because it would end up being a full time project just trying to help.

My suggestion would be to tough it out and start with simpler things and work your way up. That’s pretty much the only way to go about it, unless you want to pay someone to help you.

I myself can’t help with any of that because I don’t know anything about drag or lift or thrust.The only kind of RPM calculation I’ve ever done is for a car game.

So I hope I don’t sound too harsh but you would be doing pretty well to get help on something as complicated as this. People fin it hard enough getting help for FPS games and the like. Who knows, maybe I’m completely wrong about this and there are many people willing to help but I don’ think so. Good luck :wink:

EDIT: Would be a good idea to learn python, so you can apply velocity and stuff more easily, as I think this would help.

Eaglestrike

IMHO
The engine/prop rpm, undercarriage & flap models are just a finalizing details to add to your working flight dynamics model. Do you have one?

  1. If you mean a prop caused torque, then no idea.
  2. High rpm for the speed & acceleration and low rpm for the endurance. Prop efficiency is lower at very low and high speed.
  3. Just add some drag and nose down pitching up to the Vle, Maximum landing gear extended speed.
  4. Just add some lift, drag and nose down pitching up to the Vfe, Maximum flap extended speed.
  5. I’m not sure, what do you mean.

BTW I’m a aware about three different flight physics more or less related projects here. Yours, Nikolay’s and mine… ONLY. Not too many.

I don’t have much physics now, it is mostly about camera interaction and the model. Though I implemented banking during turns. Check this http://www.youtube.com/watch?v=38olngsF7Gk

Eaglestrike

The key point in understanding flight physics is that to turn left /right, the airplane should roll, because it is x component of the lift force, that causes radial accelaration. Meanwhile, if airplane rolls, its y component of the lift force decreases. To compensate that , pilot should increase velocity (thrust).

In my arcade model thrust is adjusted automatically when turning, so the airplane does not “dive”.

Another difference with Xjazz, is the in my model everything is faster. However it is not the model feature, I can be made more smooth. I did it this way for my gameplay requirements.

I hope it is clear

BTW, if you did the model, it is very well done. I would definitely use it for my project), but I need more modern airplanes :stuck_out_tongue:

I once listed, what my model is modeling so, please, could you list yours?

"
start

Get plane data

<loop starts>
Get local velocities
Get local angular velocities

calculate:

  • True air speed despite the attitude (TAS)
  • AOA’s
  • Turn radius
  • G’s
  • Aileron input caused lift & moment with AOA & input based Cl
  • Wing lift & moment with AOA based Cl
  • Elevator input caused lift & moment with AOA & input based Cl
  • Cross area towards the TAS
  • Drag with AOA based Cd
  • Thrust
  • Some funky self made ‘inertia’ formulas to settle the longitudinal reactions
  • Gravity force & moments

Sum the plane local forces & moments
Sum the gravity global force
<loop ends>
"

The arcade games are simulating/computing next to none so, of course those are faster at least in marginal spec pc.

By faster I meant not the calcualtions speed, but the rate airplane changes its orientation.

Ok, understand what did you meant.

Maybe the 3 of you should team up? make a working airplane model and some docs on how to do it?

Well, right now, I find more fun to devellop my own game than make tuts. I know, I am selfish :stuck_out_tongue:

I am getting ready to the game engine competition next year. By that time I will at least share my blend

I did the model… took me an entire 2 months.
Meanwhile i’m looking for some good calculations. SInce you guys have a good python experience, I thought It would be good to share info. Unfortunately I’m just a tenth grader, a smart one who’s in the high stream, but as a result I haven’t learnt trig yet. I’ve got Youtube vids (http://www.youtube.com/watch?v=F21S9Wpi0y8). For the flight dynamics model I’ve got :

I’ll keep on going for the moment. Earlier someone also told me that flaps increase wing area (which will make my calculations easier). And for the gear I think the drag is created by drag (surface area x mass flow of air?) and the wheels (rolling drag).

Keep on posting and If you could put up links to your posts it would be great.

P.S. I also had an earlier project on a Polikarpov I-16, if anyone remembers. I got the controls working with the mouse and the IPO’s sorted. It failed… sort of, although I got valuable python experience.

I have an error that I can’t solve. Im trying to get the mouse to alter a value (that value will control an Ipo for the ailerons and the torque). Here is the code: (Note: the same code when I used in another situation worked perfectly)


ypos = mouse.getYPosition()
xpos = mouse.getXPosition()
wid = Rasterizer.getWindowWidth()/2
hgt = Rasterizer.getWindowHeight()/2
Rasterizer.setMousePosition(wid, hgt)
### 'o'  gets the Object Owner
x = xpos-wid
y = ypos-hgt
o.x += x
o.y += y

Now, for some reason, the value starts off at x = -271 y = -241 even though it should start off at 0 and then change as the mouse moves. But it doesn’t. And I can’t work it out. :frowning:

AAH!! I can’t work out my mouse function!!! I know what the error is, just not the way to fix it!! Apparantly the mouse position starts of at the window length, regardless of what the mouse position actually is. I just don’t know why this is happening!!:frowning:

Try this mouse script
http://blenderartists.org/forum/showthread.php?p=1399791&highlight=mouse#post1399791

Thats way too complicated. I came up with a timer value that waited for a tenth of a sec, enough for the mouse to set itself at 0.

I need help in some trig here:
The angle of attack is calculated using the x and y velocities (i got that from Xjazz’s script using inverse trigonometrical functions). I need to keep the physics simple, and I’m confused with the number of coefficients for the hinge moment etc.So I’ve decided to keep it simple to the basic rule - ailerons deflect the angle of attack for a section of the wing so that it generates less or more lift. Right now for testing ive got + and - keys controlling the angle of the aileron. SO - would the deflected angle of attack be this??:


### ailang is the aileron deflection angle
aoatan = -vz/vy #(tan of the -z velocity over y velocity)
aileronaoatan = tan(ailang)
aoa = atan(aoatan+aileronaoatan)

I hope you’re getting the point here. Please note that I have VERY little knowledge of trig (due to the education system regarding tenth grade maths), and a lot of common sense. So if someone could solve this, it would make my job easier.

Right now im assuming that aileron section is a separate generator of lift, so when the aileron angle is anything except 0 degrees it generates torque, however I think this will create problems later on. So I was wondering if I could divide the lift into two parts - left wing and right wing. These generate two lifts that balance somehow. Also, I was wondering if the elevators generate lift at 0 degrees deflection. Later on I will solve the problem of balancing the three centre forces (lift, thrust and gravity) realistically. Any help is appreciated (with a simple explanation). Btw, im trying to make a SIMPLE PHYSICS simulation right now, anything else (animation atc.) will come later as I have experiece handling it.

Hi

I calculated the whole wing as one.

The aileron caused forces I calculated based to the wing-aileron size and lever arm. End result is a moment around longitudinal axis.

Simple code for the effective AOA calculation


# effective aoa with given stab, elev dimensions and elevator deflection angle

from math import degrees, radians, sin, atan, cos
from math import degrees as deg
from math import radians as rad

def rr(v,d=2):
    return round(v,d)

def EA(dim,a): # Geometric method
    ar = rad(a)        
    return (deg(atan( (dim[1] * sin(ar)) / ( (dim[1] * cos(ar)) + dim[0] ))))

def I_O(dat,iv): # Interpolation method
    return(dat[1] + ((iv - dat[0]) * (dat[3] - dat[1]))/(dat[2] - dat[0]))

# Horizontal stab & elev. dimensions for the geometric method
dim = [0.6, 0.5]

# Dataset for the interpolation method. 
# NOTE! Pre-calculated with geometric method
datas = [-32650, -18.1, 32650 , 18.1]
# +/- 32650 is a game input device raw value range

# ------------------------------------------------

# Geometric method
# Give a elevator deflection angle in degrees
a = 40.0

# Interpolation method
# Give a game input device raw value
ca = 32000

print rr(EA(dim,a)),'	Geometric method
',rr(I_O(datas,ca)), '	Interpolation method'


 

The elevator have often a Angle of Incidence so, the 0 elevator deflection cause ‘build-in’ force.

Attachments


Thanks alot! I’ve solved my side of the problem, expanding on your script by using the aoa to calculate the opposite angle etc. I don’t know anything about matrixes, but your code is a great help for the theory. I’ll be putting up an upload soon!

I’m not sure, what did you mean with the ‘opposite angle’ or ‘matrixes’ but it’s good to hear, I could help you forward :slight_smile:

Let make the BGE finally FLY :wink:

Ive got a small problem but its causing huge errors. What I basically want is to add two values and keep them as they are. Right now, if i set a +1 value, as in a = B+1, the script will add+1 60 times a second (or however long it takes to execute it). What i want, is that a will always be b + 1, as I need that for the lift from the rest of the wing + wing from aileron section.