COG or COM understanding? Flight dynamics

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: COG or COM understanding? Flight dynamics

Postby Julio Jerez » Tue Nov 27, 2012 12:27 pm

if you type aerodynamics drag in wikipedia you can read how it works and why. I can give you a practical way of how to go about using it. using it right you shoudl be able to model realistically any convetional aiplane.
basically aerodynamics lift and drag are empirical equation that approximate very accurately the behavior of an airfoil travelling on a steady fluid and at low velocity.
the form for both expressions are similar

[list=]F = 0.5 * r * C * A * v ^ 2
where:
F = is the magnitude of drag or lift force at the center of pressure of the airfoil
r = is the density of the fluid
V is the velocity of the foil center of pressure relative to the fluid,
C is the or lift coefficient
A area of the foild,[/list]
in the equation r, C and A for a given air for are constant, however

A (the airfoil area) can be control by a typical fold generation what is know the Control surface
basically rudders and aileron are devices that change slightly the area A of the foil
the difference between drag and lift is that the drag line of action the vector directly opposed to the to the air relative velocity of the foil center of pressure

those are the only componet that you need to use to control the plane
the procces can be like this

-for each foil do
-calculate the velocity of the center of preasure
let P be the local center of pressure in global space,
let V, W the linear and angular velocity of the plane
let V0 the velocity of the wind
Vf = V + cross (W, P) - V0

as you can see Vf is different for each side of the plane when the play is turn
this is what implicitly genaret the rolling drag of the plane

-calculate the angle of attack (you do tha already)
-Calculate the the surface Area,
-Calculate the lift Fl and Fd force magnitude
-calculate direction vector of Lift and direction vector of Drag and scale those vector by Fl and Fd
F = liftDir.Scale (Fl) + dragDir .Scale (Fd)

-calculate the torque generate by this airfoil on the plane
let COM be teh center of mass of the plane in global space
T = cross (F, P - COM)

-add that force and torque to the body

after you do that for each air foil, then you add the Gravity force, plus teh trusth forces generated by any engine
and that is all.

you can consider the body of the plane as a special airfoil with a large coefficient of drag and very low coefficient of lift (for most airplane the body is the main source of Drag)
if you do that and after you fix the bugs you should have a very realistic flight model that can match any non supersonic flighing vehicle.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: COG or COM understanding? Flight dynamics

Postby andygib » Tue Nov 27, 2012 12:34 pm

Hi Julio I am already doing all what you have said exactly like that, i will go though and check everything against what you have said.

Joe, thanks fot that. Where do i atually apply this though, to the final force? (i say that as you have force* =)

Thanks
Andy
andygib
 
Posts: 40
Joined: Fri Jan 13, 2012 7:47 am

Re: COG or COM understanding? Flight dynamics

Postby JoeJ » Tue Nov 27, 2012 2:43 pm

andygib wrote:Where do i atually apply this though, to the final force? (i say that as you have force* =)


Yes, that means multiply every force affected by AOA with that damp value.
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: COG or COM understanding? Flight dynamics

Postby andygib » Tue Nov 27, 2012 3:46 pm

This seems so trivial yet i cannot get it to work.

At the moment i doing this:
Code: Select all
bodyv = GetBodyVelocity(planebody,1) //Body velocity in global space
lairspeed = Magnitude(bodyv)
dragforce = 0.5*cd1*(lairspeed^2)*plane.airfoil.a[i]*1.22
lift_force = 0.5*cl1*(lairspeed^2)*plane.airfoil.a[i]*1.22


and this flies ok, but i want to calculate the velocity at the center of pressure of the airfoil, julio you said in your last post:
-for each foil do
-calculate the velocity of the center of preasure
let P be the local center of pressure in global space,
let V, W the linear and angular velocity of the plane
let V0 the velocity of the wing
Vf = V + cross (W, P) - V0


But doing this makes my plane not fly at all. So a few things to clear up.
-for each foil do
-calculate the velocity of the center of preasure
let P be the local center of pressure in global space,
let V, W the linear and angular velocity of the plane <-- ARe these in global space?
let V0 the velocity of the wing <-- isnt this what we are meant to be finding? (wind?)
Vf = V + cross (W, P) - V0

Thanks for the help
Andy
andygib
 
Posts: 40
Joined: Fri Jan 13, 2012 7:47 am

Re: COG or COM understanding? Flight dynamics

Postby Julio Jerez » Tue Nov 27, 2012 5:38 pm

andygib wrote:But doing this makes my plane not fly at all. So a few things to clear up.
-for each foil do
-calculate the velocity of the center of preasure
let P be the local center of pressure in global space,
let V, W the linear and angular velocity of the plane <-- ARe these in global space?
let V0 the velocity of the wing <-- isnt this what we are meant to be finding? (wind?)
Vf = V + cross (W, P) - V0
Thanks for the help
Andy


V0 is wind not wing, my mistake, by changing this you can reproduce air speed contitions during flight,
for example if you hit a wind corrent your vehicle will gain more lift and at the same time more grad
so it will fly sllwlly but consume less fuel.

V, W you read form teh body, therefore thay al already in global space

the only value you nee to worrie about is how to get P
for that ket us say you take the righ wing of teh airplace
let us say the coodinate system is
1, 0, 0 is the right
0, 1, 0 is up
0, 0, 1 is front

let us say the the center wing span of the wing is 3.5 metters an dthe cente of pressure is a teh cente of the wing
therefore the center of pressure will be vector CP (3.5 / 2, 0, 0)

now to ge the center of pressure in global space you simply get the matrix from the body and you rotate the Cp vector, that is

P = RotateVector (vehicle matrix, CP)

after that you have everything you need in global space.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: COG or COM understanding? Flight dynamics

Postby andygib » Wed Nov 28, 2012 6:06 am

HI julio, so this Vf = V + cross (W, P) - V0 result in a vector? HOw do ithen use this in the lift equation? Do i find its magnitude?

Thanks
Andy
andygib
 
Posts: 40
Joined: Fri Jan 13, 2012 7:47 am

Re: COG or COM understanding? Flight dynamics

Postby Julio Jerez » Wed Nov 28, 2012 7:13 am

the lift equation uses v^2

that is v2 = dotproduct (v, v)
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: COG or COM understanding? Flight dynamics

Postby andygib » Wed Nov 28, 2012 7:37 am

ok, so my code is :

for each airfoil:
Code: Select all
plane.airfoil.pos[1] = Vec3(8,1,-1) --left wing COM (ft)
plane.airfoil.pos[2] = Vec3(-8,1,-1) --right wing COM (ft)
plane.airfoil.pos[3] = Vec3(0,0.5,-15) --tail wing COM (ft)
plane.airfoil.pos[4] = Vec3(0,5,-15) --vert left wing COM (ft)
plane.airfoil.pos[5] = Vec3(0,5,-15) --vert right wing COM (ft)
plane.airfoil.pos[6] = Vec3(0,0,-1) --fuselarge COM (ft)

bodyv = GetBodyVelocity(planebody,1) //Body Velocity global
bodyav = GetBodyOmega(planebody,1) //Body Angular Velocity global
         
lvel = AddVec(bodyv,cross(bodyav,TFormPoint(plane.airfoil.pos[i],planebody,nil))) //TFormPoint(plane.airfoil.pos[i],planebody,nil) <--This transforms from airfoil position from planebody coords to global
localairspeed = dot(lvel,lvel) //airspeed

dragforce = 0.5*cd1*(lairspeed)*plane.airfoil.a[i]*1.22
lift_force = 0.5*cl1*(lairspeed)*plane.airfoil.a[i]*1.22


Does the above look correct as this is causes big issues for some reason.

Thanks
Andy
andygib
 
Posts: 40
Joined: Fri Jan 13, 2012 7:47 am

Re: COG or COM understanding? Flight dynamics

Postby Julio Jerez » Wed Nov 28, 2012 7:52 am

this is wrong
lvel = AddVec(bodyv,cross(bodyav,TFormPoint(plane.airfoil.pos[i],planebody,nil)))

if you do not have a funtion that rotate a local position replace this
TFormPoint(plane.airfoil.pos[i],planebody,nil)

with

wingPositGlobal = TFormPoint(plane.airfoil.pos[i],planebody,nil) - plane.com_in_globalspace

then
lvel = AddVec(bodyv,cross(bodyav,wingPositGlobal))
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: COG or COM understanding? Flight dynamics

Postby andygib » Wed Nov 28, 2012 8:08 am

Ok, ill have to check there is no bug in leadwerks as when i do this, as soon as the plane start to rotate just a little bit, the plane goes crazy and airspeed goes massive.

So either something is wrong in my calculations or a bug.

If i use JUST the plane velocity in my equations and NOT the airfoil velocity it works.

Thanks
Andy
andygib
 
Posts: 40
Joined: Fri Jan 13, 2012 7:47 am

Re: COG or COM understanding? Flight dynamics

Postby Julio Jerez » Wed Nov 28, 2012 8:50 am

that's because you are transforming the wing center instead of rotating it.
if vector p is the local position of the wing center and planeMatrix is the plane matrix
then the local position in global space is

pg = TransformVector (planeMatrix, p) - planeMatrix.GetPosition()

the the given V and W and the velocity of teh plane, the wing center velocity is

Vwing = V + Cross (w, pg)

the term Cross (w, pg) is a small contribution but it is important because it is the term that generates the angular rolling resistance as an emerging phyics behavior.
if you do no add that then the vehicle become unstable when tunring,

the reason is that when the plane is turning teh wing that is farthe away move faster, therfore have more drag, an more lift.
effects like airplane banking to the side whe turning, simple because one wing have more lift than thet other comes from that simple cross term.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: COG or COM understanding? Flight dynamics

Postby andygib » Wed Nov 28, 2012 11:36 am

Ok, but one thing i dont understand about this is:

im my plane is moving in Z by 100, the equation above means all airfoil points are also moving at 100, adding these up gives me 1000? which makes plane go crazy?

Thanks
Andy
andygib
 
Posts: 40
Joined: Fri Jan 13, 2012 7:47 am

Re: COG or COM understanding? Flight dynamics

Postby andygib » Wed Nov 28, 2012 12:00 pm

Ok, i think i have this working now.

Seems better too :)

Thanks
Andy
andygib
 
Posts: 40
Joined: Fri Jan 13, 2012 7:47 am

Re: COG or COM understanding? Flight dynamics

Postby Julio Jerez » Wed Nov 28, 2012 12:42 pm

did you get the ide of a local position in global space?
I can post and image if you are not clear still.

if you get a betrr model, can you make a new video?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: COG or COM understanding? Flight dynamics

Postby andygib » Wed Nov 28, 2012 4:39 pm

Hi julio, yes i think so. But a picture would be much appriciated. Would help me check im understanding correctly.

I am uploading a new short video now.

Im still having the same issue of "glide Speed", for some reason the glide speed is slow, like there is too much drag, but i using the correct coefficient values.

Thanks
Andy
andygib
 
Posts: 40
Joined: Fri Jan 13, 2012 7:47 am

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest