1 /***************************************************************************
5 ----------------------------------------------------------------------------
7 FUNCTION: Linear aerodynamics model
9 ----------------------------------------------------------------------------
11 MODULE STATUS: developmental
13 ----------------------------------------------------------------------------
15 GENEALOGY: Based upon class notes from AA271, Stanford University,
16 Spring 1988. Dr. Robert Cannon, instructor.
18 ----------------------------------------------------------------------------
20 DESIGNED BY: Bruce Jackson
22 CODED BY: Bruce Jackson
24 MAINTAINED BY: Bruce Jackson
26 ----------------------------------------------------------------------------
31 921229 Changed Alpha, Beta into radians; added Alpha bias.
33 930105 Modified to support linear airframe simulation by
34 adding shared memory initialization routine. EBJ
35 931013 Added scaling by airspeed, to allow for low-airspeed
36 ground operations. EBJ
37 940216 Scaled long, lat stick and rudder to more appropriate values
38 of elevator and aileron. EBJ
40 ----------------------------------------------------------------------------
44 The Navion "aero" routine is a simple representation of the North
45 American Navion airplane, a 1950-s vintage single-engine, low-wing
46 mono-lane built by NAA (who built the famous P-51 Mustang) supposedly
47 as a plane for returning WW-II fighter jocks to carry the family
48 around the country in. Unfortunately underpowered, it can still be
49 found in small airports across the United States. From behind, it sort
50 of looks like a Volkswagen driving a Piper by virtue of its nicely
51 rounded cabin roof and small rear window.
53 The aero routine is only valid around 100 knots; it is referred to as
54 a "linear model" of the navion; the data having been extracted by
55 someone unknown from a more complete model, or more likely, from
56 in-flight measurements and manuever time histories. It probably came
57 from someone at Princeton U; they owned a couple modified Navions that
58 had a variable-stability system installed, and were highly
59 instrumented (and well calibrated, I assume).
61 In any event, a linearized model, such as this one, contains various
62 "stability derivatives", or estimates of how aerodynamic forces and
63 moments vary with changes in angle of attack, angular body rates, and
64 control surface deflections. For example, L_beta is an estimate of how
65 much roll moment varies per degree of sideslip increase. A decoding
68 X Aerodynamic force, lbs, in X-axis (+ forward)
69 Y Aerodynamic force, lbs, in Y-axis (+ right)
70 Z Aerodynamic force, lbs, in Z-axis (+ down)
71 L Aero. moment about X-axis (+ roll right), ft-lbs
72 M Aero. moment about Y-axis (+ pitch up), ft-lbs
73 N Aero. moment about Z-axis (+ nose right), ft-lbs
75 0 Subscript implying initial, or nominal, value
76 u X-axis component of airspeed (ft/sec) (+ forward)
77 v Y-axis component of airspeed (ft/sec) (+ right)
78 w Z-axis component of airspeed (ft/sec) (+ down)
79 p X-axis ang. rate (rad/sec) (+ roll right), rad/sec
80 q Y-axis ang. rate (rad/sec) (+ pitch up), rad/sec
81 r Z-axis ang. rate (rad/sec) (+ yaw right), rad/sec
82 beta Angle of sideslip, degrees (+ wind in RIGHT ear)
83 da Aileron deflection, degrees (+ left ail. TE down)
84 de Elevator deflection, degrees (+ trailing edge down)
85 dr Rudder deflection, degrees (+ trailing edge LEFT)
87 ----------------------------------------------------------------------------
91 ----------------------------------------------------------------------------
95 ----------------------------------------------------------------------------
99 ----------------------------------------------------------------------------
103 --------------------------------------------------------------------------*/
105 #include "ls_types.h"
106 #include "ls_generic.h"
107 #include "ls_cockpit.h"
109 /* define trimmed w_body to correspond with alpha_trim = 5 */
110 #define TRIMMED_W 15.34
112 extern COCKPIT cockpit_;
115 void navion_aero( SCALAR dt, int Initialize ) {
119 static SCALAR elevator, aileron, rudder;
120 static SCALAR long_scale = 0.3;
121 static SCALAR lat_scale = 0.1;
122 static SCALAR yaw_scale = -0.1;
123 static SCALAR scale = 1.0;
125 /* static SCALAR trim_inc = 0.0002; */
126 /* static SCALAR long_trim; */
157 /* Initialize aero coefficients */
163 X_u = -0.0451; /* original value */
164 /* X_u = 0.0000; */ /* for MUCH better performance - EBJ */
168 Z_u = -0.3697; /* original value */
169 /* Z_u = -0.03697; */ /* for better performance - EBJ */
187 u = V_rel_wind - U_0;
188 w = W_body - TRIMMED_W;
190 elevator = long_scale * Long_control;
191 aileron = lat_scale * Lat_control;
192 rudder = yaw_scale * Rudder_pedal;
194 /* if(Aft_trim) long_trim = long_trim - trim_inc; */
195 /* if(Fwd_trim) long_trim = long_trim + trim_inc; */
197 scale = V_rel_wind*V_rel_wind/(U_0*U_0);
198 if (scale > 1.0) scale = 1.0; /* ebj */
201 F_X_aero = scale*(X_0 + Mass*(X_u*u + X_w*w + X_de*elevator));
202 F_Y_aero = scale*(Mass*Y_v*V_body);
203 F_Z_aero = scale*(Z_0 + Mass*(Z_u*u + Z_w*w + Z_de*elevator));
205 M_l_aero = scale*(I_xx*(L_beta*Beta + L_p*P_body + L_r*R_body
206 + L_da*aileron + L_dr*rudder));
207 M_m_aero = scale*(M_0 + I_yy*(M_w*w + M_q*Q_body + M_de*(elevator + Long_trim)));
208 M_n_aero = scale*(I_zz*(N_beta*Beta + N_p*P_body + N_r*R_body
209 + N_da*aileron + N_dr*rudder));