Is flight Simulation possible with NGD?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Is flight Simulation possible with NGD?

Postby Gibbon » Tue Dec 15, 2009 5:34 am

Hi all ,new here :)
I am having no luck what so ever with flight simulation using Newton Game Dynamics so i have arrived here for some expert help.
Im using leadwerks 3D engine, lua and C++ and newton game library to try and create... even the most simple flight simulator for now, but failing miserably.

I fly myself and a big aviation fan, I have plenty of books which ive used for reference, and tried many many equations now (as i doubted my original ones) but to no avail.

It seems it doesnt matter how i do my equations for lift, drag, thrust ETC i end up with the same problem. The plane acts to heavy in flight, although i know thats not the problem because even i drop the masses and up the velocity i have the same problem but just faster.

When i say it acts to heavy, if i have a plane moving forward along its thrust velocity and i elevate the plane to go up, the plane will pitch up (rotate on its axis) but it will carry on along its foward vector for a while before it starts to go up in the direction it is facing. I can pitch the plane so its thrust vector is vertically up yet it will take a while to slow down on its old foward vector before it starts to go up in its new direction. Like i said, as if its to heavy. (i bit like a car drifting)

All forces and torque are local, ive checked and double checked that. I played with masses, friction, gravity, thrust and my equations but no matter what i do, i end up with the same problem.

What i have noticed is, on this site on the downloads page, links page and video page there are no flight simulations, mostly cars ETC.

So... am i just barking up the wrong tree or am i deffinatly doing somthing wrong.

Thanks
Andy
Gibbon
 
Posts: 44
Joined: Tue Dec 15, 2009 5:18 am

Re: Is flight Simulation possible with NGD?

Postby Julio Jerez » Tue Dec 15, 2009 6:20 am

I flight sim is a very trivial thong to do , you jst nee to apply eth forc of lift genertaed bu teh wings, to the body.
those force need to be apply on teh force and torque call back, how did you write it?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Is flight Simulation possible with NGD?

Postby Gibbon » Tue Dec 15, 2009 7:00 am

Julio Jerez wrote:I flight sim is a very trivial thong to do , you jst nee to apply eth forc of lift genertaed bu teh wings, to the body.
those force need to be apply on teh force and torque call back, how did you write it?


Hi Julio, thanks for replying. I remember reading a similer statement to that before i started my project! Im not finding it so simple.

I simply have my plane, i have the main fuselarge body, main wing body and tail wing body all with fixed joints.

I am calculating the lift from the wing using:

CL = coeificient of Lift
r = Air Density : 0.0027
V = Velocity
a = wing area
AoA = Angle of attack (simply the plane angle in radians)

Lift = .5 * CL * r * V^2 * a
CL = 2 * pi *AoA (in radians)

The drag one is similer but acting against thrust.
Thrust is a simple calculation for now thats a division of RPM.

So i then add the forces to the model like so:

lift force is added to the wingbody's Y vector locally
thrust force is added to the fuselarge body's Z vector locally
Drag force is added to the fuselarge body's -Z vector locally
gravity force is added to the fuselarge body's -Y global

Then simply using arrows keys i have tried both:
Upkey = apply force at point : tail wing body -Y local
downkey = apply force at point : tail wing body Y local
or
upkey = apply torque to fuselarge body ETC
downkey = apply torque to fuselarge body ETC

Neither make a huge differences, but do not solve the problem.

All force work, but the plane acts.... well not like a plane. Like i said, it doesnt follow its "heading vector" correctly?

I apply thrust, it will move forward, i pitch the plane up by adding either a force to the tail or torque and the plane rotates but it carries on going forward and then eventually starts to go up, its like its "delayed" and catches up with itself??? But i can complety rotate the plane around upside down so its pointing back at me and it will be then moving backwards until it stops and then slowly starts coming back towards me again... strange!

Do you know what i mean?

Thanks
Andy
Gibbon
 
Posts: 44
Joined: Tue Dec 15, 2009 5:18 am

Re: Is flight Simulation possible with NGD?

Postby Julio Jerez » Tue Dec 15, 2009 7:58 am

an airplane need more than that

you alos nee to calculate teh torque generated by teh lift forces, taht is frios each wind you need to calculate teh lift force teh way you are doing it, the apply a toque tah is calculate by teh cros product of teh force and teh airodynamics cente of thr wing,

tah include righn, left wing,
righ and left stabilized,
rouders, and if you wna to be fance the effect of the airplane body.
plus the force and torque generated bu teh engines at the point of action
plus thr force of gravity at teh airplane center.
plsu ethe force and toque of drag and air density.


it is the some of all those forces and all those torque calculate separated and add togerther that lift the place.

when the net torque is zero the airplane is stable, when the torque is umbalanced the airplane turns.
when force in up direction is positive the plain goes up, and is zero the plane is in straight flight, when it is negative the plane descend
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Is flight Simulation possible with NGD?

Postby Gibbon » Tue Dec 15, 2009 8:15 am

Hi thanks for that Julio, I will have to look into this more then.

How do i calculate the torque generated by the lifting forces?

and also how do i do : "then apply a toque that is calculated by the cross product of the force and the aerodynamics cente of the wing"

I know you a busy guy, but your help is very much appriciated.

Thanks Julio
Andy
Gibbon
 
Posts: 44
Joined: Tue Dec 15, 2009 5:18 am

Re: Is flight Simulation possible with NGD?

Postby Aphex » Sun Dec 20, 2009 8:04 am

It sounds like you're applying the forces at the centre of mass - basically you want to apply them off-centre and this will give you a torque (imagine pushing a pencil along a desk at its centre vs pushing at one end.)
See here for (my) implementation http://newtondynamics.com/forum/viewtopic.php?f=9&t=4646&p=33429
Aphex
 
Posts: 144
Joined: Fri Jun 18, 2004 6:08 am
Location: UK


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests