(inSky)

 找回密码
 立即加入

QQ登录

只需一步,快速开始

查看: 2513|回复: 9

气动参数研究

[复制链接]
发表于 2008-9-24 22:21:07 | 显示全部楼层 |阅读模式
以后会慢慢添的,先贴一点我发现的,用来改8爷在woi中的启动

Longitudinal
  Cl0 - Reference lift at zero alpha
  Cd0 - Reference drag at zero alpha
  Cla - Lift curve slope (w.r.t. alpha)
  Cda - Drag curve slope (w.r.t. alpha)
  Clq - Lift due to pitch rate
  Cladt - Lift due to alpha rate

  Cmadt - Moment due to alpha rate
  Cm0 - Reference moment at zero alpha
  Cma - Pitching moment slope (w.r.t. alpha)

Lateral
  Cyb - Side force due to sideslip
  Cyr - Side force due to yaw rate

  Clb - Dihedral effect (roll moment due to sideslip)
  Clp - Roll damping (roll moment due to roll rate)
  Clr - Roll moment due to yaw rate
  Cnb - Weathercocking stability (yaw moment due to sideslip)
  Cnp - Rudder adverse yaw (yaw moment due to roll rate)
  Cnr - Yaw damping (yaw moment due to yaw rate)

Control
  Clde - Lift due to elevator
  Cdde - Drag due to elevator
  Cydr - Side force due to rudder

  Cmde - Pitch moment due to elevator
  Clda - Roll moment due to aileron
  Cndr - Yaw moment due to rudder
  Cnda - Yaw moment due to aileron
回复

使用道具 举报

 楼主| 发表于 2008-9-24 22:23:23 | 显示全部楼层
以下介绍的是怎么计算

Some sources of  simulator code
last page update Dec.  2003
     For  a complete \'scientific\' simulation I imagine one needs to work from calculated forces on each main surface,   the moments of inertia around the centre of mass, the damping of rotation,   the  effects of incidence and speed  on the wings given their section and planform ... etc etc.   Some modern commercial sims  seem to have a complex flight model that matches most of these parameters, and the users seem to want such realism.
       It seems to me , that for complete realism you need more than the standard approach.  A real plane has a lot of subtle variation in the the flight surface reaction at different speeds  and flight angles.  It is not just a linear reaction  but a curved and variable one. One surface interferes with another if the slipstream is altered .. etc.
The most subtle and accurate flight model I have seen so far, is used in a Radio controlled model slope soaring simulator.      Apparently the  essential flight code is public domain, from an opengl program called \'crrsim\'.  Anyway, you can read about it and download the quite small program and optional  files at  >  http://www.rowlhouse.co.uk/sss/index.html
-------------------------------------------------------------

And if you want an idea of how  normal  flight simulation is done, here is a page   in quaint english,  but by a very willing and open person. Taken from -   glhorizon at :-      http://www.web-discovery.net/links
  

Introduction
I received lot of emails asking me how to build a realistic flight model. First af all i want to make it clear that i\'m not a physics or aerodynamic specialist, and all i\'ve learnt is from documents and precious help i found searching on the web and asking to people which actually pointed at me the right answers. And i experimented a lot, really a lot, to achieve what i believe, now, to be a quite realistic flight model.
Just to help everybody willing to build his own flight simulation, I wrote this document which explain, quite in detail, how to build a flight model starting from user input and aircraft carachteristics, calculating all the forces, moments acting on the aircraft, and translating angular and linear velocities in aircraft angles and position updates.
This paper doesn\'t explain the theory of flight, so if you don\'t know absolutely anything about that i suggest you study some theory of flight first, otherwise what you\'ll read below here will be quite no-sense.
  

U,V,W are the aircraft linear velocities along X,Y,Z axis in feet/sec
P,Q,R are the aircraft angular velocities around X,Y,Z axis in radians/sec
Ua,Va,Wa are the aircraft linear accelerations along X,Y,Z axis in feet/sec2
Pa,Qa,Ra are the aircraft angular accelerations around X,Y,Z axis in radians/sec2
Fx,Fy,Fz are the forces acting on aircraft
L,M,N are the moments about the X,Y,Z axis
alpha is the angle of attack (AOA)
beta is the angle of sideslip
elevator, aileron and rudder are the control deflections that pilot commence through the stick and are expressed in radians (of course you\'ve to build you\'re own joystick or keyboard routine to simulate the pilot stick)
thrust is the engine power that pilot commence through the throttle control
b is the wing span in feet
S is the wing surface area in feet2
c is the chord length in feet

Very important is to define the specific aircraft parameters, since every aircraft has its own inertial and aerodynamic coefficients, weight, dimensions, mass properties etc. Finding these parameters might not be easy, but there are some informations available on the web. I\'m collecting data in a database which i\'ll publish soon, but as you\'ll see lot of stuff is missing, if somebody can help email me !
gravitational_acceleration = 32.174 ft/s2
aircraft_mass = weight/gravitational acceleration
speed = sqrt (U2 + V2 + W2)
alpha = atan(W/U)  alpha is 0 when W velocity (i.e. vertical velocity) is equal to 0
beta = atan(V/U)    beta is 0 when V velocity (i.e. side velocity) is equal to 0
beta can be calculated also as asin(V/speed)
  

Now is time to calculate lift and drag

lift_coefficient = CLo + CLa*alpha + CLde*elevator

CLo is the reference lift at zero angle of attack
CLa is the lift curve slope
CLde is the lift due to elevator

drag_coefficient = CDo + CDa*alpha + CDde*elevator

CDo is the reference drag at zero angle of attack
CDa is the drag curve slope
CDde is the drag due to elevator

Calculation of lift and drag coefficients takes into account also other parameters, which i avoided to mention to simplify this paper and because their effect is quite minimal: but if you want to make a very very realistic simulation, you have to include them. I suggest you study this document

Lift = lift_coefficient * qbarS

Drag = drag_coefficient * qbarS

where qbarS is the dynamic pressure and is defined as ( rho * speed2 * S / 2 )

and, in detail, speed is the aircraft speed, rho is the air density at a certain altitude and S is the wing area surface in feet2
  

Calculating aero forces

Fx = lift*sin(alpha) - drag*cos(alpha) + thrust;
Fz = -lift*cos(alpha) - drag*sin(alpha);
Fy = (CYb*beta + CYdr*rudder)*qbarS;
  

Calculating linear accelerations

Ua = V*R - W*Q - gravitational_ acceleration * sin(theta) + Fx/slugs;
Wa = U*Q - V*P + gravitational_ acceleration * cos(phi)*cos(theta) + Fz/aircraft_mass;
Va = W*P - U*R + gravitational_ acceleration * sin(phi)*cos(theta) + Fy/aircraft_mass;
  

Calculate linear velocities

U= U + Ua;
W=W + Wa;
V= V + Va;
  

Calculate moments

L = (CLb*beta + CLp*P*b/(adjust*speed)+CLr*R*b/(speed)+Clda*aileron+CLdr*rudder)*qbarS*b; // Roll
M = (CMo + CMa*alpha+CMq*Q*c/(speed)+CMde*elevator)*qbarS*c; // Pitch
N = (CNb*beta + CNp*P*b/(speed) + CNr*R*b/(speed) + CNda*aileron + CNdr*rudder)*qbarS*b; // Yaw

CLb is the dihedral effect
CLp is roll damping
CLr is the roll due to yaw rate
Clda is the roll due to aileron
CLdr is the roll due to rudder

CMo is the pitch moment coefficient
CMa is the pitch moment coefficient due to angle of attack
CMq is the pitch moment coefficient due to picth rate
CMde is the pitch coefficient due to elevator

CNb is the weather cocking stability
CNp is the rudder adverse yaw
CNr is the yaw damping
CNda is the yaw due to aileron
CNdr is the yaw due to rudder

One note: you understand that it is extremely important to know all the coefficients of the aircraft you want to simulate. I started with the coefficients of the A-4 Sparrow, but then i was lucky to find a software of aerodynamics calculations ( check www.darcorp.com ) where i found the F22 Raptor ones. As i told before, i\'d like to build a reference database with all the known coefficients and parameters of all aircrafts.it\'s quite utopistic i know, but let\'s just start and see.
  

Calculate the rotational body axis accelerations

Just assuming that :

Ixx is the roll inertia in slug/feet2
Iyy is the pitch inertia in slug/feet2
Izz is the yaw inertia in slug/feet2
Ixz is the overall inertia along the trasversal Y-Z in slug/feet2

If fuel consumption or weapon drops are to be simulated, the previous inertial parameters and the mass of the aircraft should be updated in each loop.

Now we will arrange the inertial parameters and combine them to calculate the aircraft angular accelerations:

ixz2 = Ixz*Ixz
cc[0] = 1/(Ixx*Izz - ixz2)
cc[1] = cc[0]*((Iyy-Izz)*Izz - ixz2)
cc[2] = cc[0]*Ixz*(Ixx - Iyy + Izz)
cc[3] = cc[0]*Izz
cc[4] = cc[0]*Ixz
cc[7] = 1/Iyy
cc[5] = cc[7]*(Izz - Ixx)
cc[6] = cc[7]*Ixz
cc[8] = cc[0]*((Ixx - Iyy)*Ixx + ixz2)
cc[9] = cc[0]*Ixz*(Iyy - Izz - Ixx)
cc[10] = cc[0]*Ixx

Pa = (cc[1]*R + cc[2]*P)*Q + cc[3]*L + cc[4]*N
Qa = cc[5]*R*P + cc[6]*(R*R - P*P) + cc[7]*M
Ra = (cc[8]*P + cc[9]*R)*Q + cc[4]*L + cc[10]*N

Pa,Qa,Ra are the aircraft angular accelerations expressed in rad/sec2 about the X,Y,Z axis

From these we can calculate the aircraft rotational velocities down here:

P = P + (3*Pa - vlastPdot)
Q = Q + (3*Qa - vlastQdot)
R = R + (3*Ra - vlastRdot)

where vlastPdot,vlastQdot,vlastRdot are the previous values of Pa, Qa, Ra (that you get at the end of the main loop)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-9-24 22:25:13 | 显示全部楼层
Calculating theta, phi, psi to rotate aircraft at new angle position

To achieve this, we have to feed above values and solve quaternion calculations which will provide the angles we want:

vQdot1 = -0.5*(vQtrn2*P + vQtrn3*Q + vQtrn4*R)
vQdot2 = 0.5*(vQtrn1*P + vQtrn3*R - vQtrn4*Q)
vQdot3 = 0.5*(vQtrn1*Q + vQtrn4*P - vQtrn2*R)
vQdot4 = 0.5*(vQtrn1*R + vQtrn2*Q - vQtrn3*P)

vQtrn1 = vQtrn1 + 0.5*(vlastQdot1 + vQdot1)
vQtrn2 = vQtrn2 + 0.5*(vlastQdot2 + vQdot2)
vQtrn3 = vQtrn3 + 0.5*(vlastQdot3 + vQdot3)
vQtrn4 = vQtrn4 + 0.5*(vlastQdot4 + vQdot4)

epsilon = sqrt(vQtrn1*vQtrn1 + vQtrn2*vQtrn2 + vQtrn3*vQtrn3 + vQtrn4*vQtrn4)
inv_eps = 1/epsilon

vQtrn1 = inv_eps*vQtrn1
vQtrn2 = inv_eps*vQtrn2
vQtrn2 = inv_eps*vQtrn2
vQtrn3 = inv_eps*vQtrn3

vlastQdot1 = vQdot1
vlastQdot2 = vQdot2
vlastQdot3 = vQdot3
vlastQdot4 = vQdot4

Q0Q0 = vQtrn1*vQtrn1
Q1Q1 = vQtrn2*vQtrn2
Q2Q2 = vQtrn3*vQtrn3
Q3Q3 = vQtrn4*vQtrn4
Q0Q1 = vQtrn1*vQtrn2
Q0Q2 = vQtrn1*vQtrn3
Q0Q3 = vQtrn1*vQtrn4
Q1Q2 = vQtrn2*vQtrn3
Q1Q3 = vQtrn2*vQtrn4
Q2Q3 = vQtrn3*vQtrn4

mTl2b11 = Q0Q0 + Q1Q1 - Q2Q2 - Q3Q3
mTl2b12 = 2*(Q1Q2 + Q0Q3)
mTl2b13 = 2*(Q1Q3 - Q0Q2)
mTl2b21 = 2*(Q1Q2 - Q0Q3)
mTl2b22 = Q0Q0 - Q1Q1 + Q2Q2 - Q3Q3
mTl2b23 = 2*(Q2Q3 + Q0Q1)
mTl2b31 = 2*(Q1Q3 + Q0Q2)
mTl2b32 = 2*(Q2Q3 - Q0Q1)
mTl2b33 = Q0Q0 - Q1Q1 - Q2Q2 + Q3Q3

theta = asin( -mTl2b13 )
psi = atan2( mTl2b12, mTl2b11 )
phi = atan2( mTl2b23, mTl2b33 )

vlastPdot = Pa
vlastQdot = Qa
vlastRdot = Ra
  

Calculating position updates

So, now we have the angles and we go for the position updates (world_x, world_y, world_z are the new increments, in feet, that should be added at current aircraft position to get the new position)

world_x = U*cos(theta)*sin(psi) + V*(cos(phi)*cos(psi)+sin(phi)*sin(theta)*sin(psi)) + W*(cos(phi)*sin(theta)*sin(psi) - sin(phi)*cos(psi))
world_y = U*sin(theta) - V*sin(phi)*cos(theta) - W*cos(phi)*cos(theta)
world_z = U*cos(theta)*cos(psi) + V*(sin(phi)*sin(theta)*cos(psi) - cos(phi)*sin(psi)) + W*(sin(phi)*sin(psi) + cos(phi)*sin(theta)*cos(psi))

So, after all these formulas, you have only to translate and rotate the aircraft at the new angles and positions et voilà !

One important thing: the aerodynamic model has a tendency to \"blow up\" if the time step between aerodynamic calculations becomes too great, so you should run the aerodynamic model at a faster rate than the rest of the system. This means you will have to create a timer in your application, and run the flight model routine at least 100-150 times for every application cycle.
  

Other calculations

g_force = 1/gravitational_acceleration * lift * gravitational_acceleration/weight,

that can be reduced to

g_force = lift/weight


--------------------------------------------------------------------------------

So you got all that above did you?   Now you know why I am glad to have found  a simple   method.  I suppose that once  the meaning of each label was  properly embeded in your head it would not be too bad, but even the idea of understanding quaternions  pains me deeply !



--------------------------------------------------------------------------------

I have taken another  pdf file linked to  from that  site, and put it here for convenience

     NPSNET : flight simulation dynamic modelling  ( 82kb)  

It was this  info.  that the DB programmer, \"eguy\"  used to help him get a working  \'proper\' simulation code.  His comments on the DB forum were :-

Hello all, an update for any who might have been interested.

I managed to build both a Euler based and a Quaternion based programs and found some
interesting things. First, quaternions are actually not all that difficult, just very unintuitive.
I believe the values being returned by the object angle commands are quaternion based,
but are unusable without the fourth variable, which you need to develop yourself.
It\'s easier (or at least I found it so) to start from scratch.

Second interesting thing I found is that the Euler method is marginally faster than quaternions,
requiring about a third less calculations per cycle.
The Euler method also has the added benefit of giving you variables that are directly
usable for other calculations (weapons launch orientations, cockpit instrument readings, etc.)
whereas quaternions must be translated back and forth, introducing further calculations.
The main drawback, of course, is that the Euler equations become undefined when certain of
your angles reach 0,90,180,270 degrees, meaning you need to constrain them (ie if angle=90 then
angle=90.1 etc.) which introduces a bit of inaccuracy to the simulation. Quaternions never become
undefined.

So what\'s better? Depends on what you\'re trying to do.
If you\'re aiming at a strictly accurate, highly intensive simulator,
quaternions are probably the way to go.
Depending on how intensive you want to be, you may need to address the speed issue
by skipping calculations during \'slow\' times when not much is happening.
If you\'re just looking for something close and fast that will produce reasonable results,
the Euler equations will work just fine.
This is what I\'m doing in my program and the inaccuracies that occur at the
cardinal points are minimal to the point of unnoticability.

If you want to be really simple and just need an orientation model that\'s easy to use
and easy to understand, there is the workaround of using the limb direction commands (use limb 0)
to get real world angles for your object directly, then just use sin and cos to get your components
and go.
It\'s never undefined and very simple to understand, though not as fast as
making your own Euler equations.
Credit for this method goes to Muddleglum, on who\'s website I found this tip.

Thanks to everyone who helped me out on this!

--------------------------

It will be interesting to see what comes of that.

-------------------------------------

There is  lot more stuff on the internet on flight in general and mathematically.  Much of it, while comprehensive,  I found not  applicable to my sim style.
Yet some maths was helpful, for example, confirming I was on the right track with my pitching/ glide formula.     I will put links here if/ when I discover where I got them from.    I usually just saved the page,  and lost the address.  Some pages I might as well reproduce here .... later .     Time to stop for now.
回复 支持 反对

使用道具 举报

发表于 2008-9-24 22:33:17 | 显示全部楼层
哇..........传说中的神帖出现了..................[s:25] [s:25] ..........放假有空就研究...........[s:17]
回复 支持 反对

使用道具 举报

发表于 2008-9-24 23:36:27 | 显示全部楼层
.......顶..........我想有幸啃熟的话,可以应征参与开发后续系列了.
回复 支持 反对

使用道具 举报

发表于 2008-9-25 10:59:57 | 显示全部楼层
先把夷文翻译过来再说。[s:50]
回复 支持 反对

使用道具 举报

发表于 2008-9-25 15:51:35 | 显示全部楼层

E文。。。

此贴甚是复杂,。。过年回家后一定要好好看看。。
回复 支持 反对

使用道具 举报

发表于 2008-9-25 16:54:55 | 显示全部楼层
太专业了吧。。。乖乖
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-9-25 21:00:16 | 显示全部楼层
纵向参数

  Cl0 - 攻角为0度时候的参考升力 (不知道攻角是什么?那不要混了,洗洗睡吧)Reference lift at zero alpha
  Cd0 - 攻角为0度时候的阻力 Reference drag at zero alpha
  Cla - 攻角/升力曲线斜度,也就是攻角上升一度升力增加的数量Lift curve slope (w.r.t. alpha)
  Cda - 攻角/阻力曲线斜度,也就是攻角上升一度阻力增加的数量Drag curve slope (w.r.t. alpha)
  Clq - Lift due to pitch rate (暂时翻译不清楚,不过data文件里没用到这个参数)
  Cladt - Lift due to alpha rate (同上)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-9-25 22:07:12 | 显示全部楼层
只找在data文件里面有用道德参数翻译

CM0 0度攻角时力矩(估计游戏引擎默认为0) is the pitch moment coefficient
CMa 攻角力矩参量 (一度攻角多大力矩)is the pitch moment coefficient due to angle of attack
CMq 攻角抬升率(攻角变化速度)参量is the pitch moment coefficient due to picth rate
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

本版积分规则

小黑屋|手机版|Archiver|(inSky)

GMT+8, 2025-5-16 10:28 , Processed in 0.057040 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表