1
0
Fork 0
flightgear/src/FDM/LaRCsim/uiuc_aero.c

98 lines
2.1 KiB
C
Raw Normal View History

2000-03-22 22:08:16 +00:00
/***************************************************************************
TITLE: uiuc_aero
----------------------------------------------------------------------------
FUNCTION: aerodynamics, engine and gear model
----------------------------------------------------------------------------
MODULE STATUS: developmental
----------------------------------------------------------------------------
GENEALOGY: Equations based on Part 1 of Roskam's S&C text
----------------------------------------------------------------------------
DESIGNED BY: Bipin Sehgal
CODED BY: Bipin Sehgal
MAINTAINED BY: Rob Deters and Glen Dimock
2000-03-22 22:08:16 +00:00
----------------------------------------------------------------------------
MODIFICATION HISTORY:
DATE PURPOSE BY
3/17/00 Initial test release
From: David Megginson <david@megginson.com> I have created a set of patches to provide configurable landing gear for the UIUC models. The patches (including four new files) are available at http://megginson.com/private/fgfs/uiuc-20010309.tar.gz A modified UIUC configuration file for the Twin Otter (DHC-6) is available at http://megginson.com/private/fgfs/aircraft.dat It should be possible to configure appropriate gear for all of the UIUC models now. As a bonus, the models also support braking, both absolute and differential, as well as nose-wheel steering (all of which are currently missing from the UIUC models) -- when you land, you don't have to keep rolling off the end of the runway anymore, and you don't have to bank to steer in a taxi. My sample configuration file contains absolutely bizarre, wild guesses, and many places that I didn't even bother to guess properly. The only actual data I had was the wing-span of the DHC-6 (65ft), which I used for positioning the wing tips. The wing-tips for this model actually work now -- I hit the aileron hard while accelerating for take-off, and the wingtip noticeably strikes the ground and bounces up (quite dramatic in external view using the DHC-6 model from Wolfram's site). Details ------- The UIUC models now support up to 16 gear points each where a gear point is anything in the aircraft that can come in contact with the ground, including the tail and wing-tips. I have added the following new fields to the UIUC configuration files, where <index> is an integer between 0 and 15, and <value> is a real number: gear <index> Dx_gear <value> # x offset from CG [ft] gear <index> Dy_gear <value> # y offset from CG [ft] gear <index> Dz_gear <value> # z offset from CG [ft] gear <index> cgear <value> # spring damping [lbs/ft/sec] gear <index> kgear <value> # springiness [lbs/ft] gear <index> muGear <value> # rolling coefficient gear <index> strutLength <value> # gear travel [ft] (not yet used) Most of these names were already pencilled into the UIUC documentation (as TODO items), but I had to make up Dx_gear, Dy_gear, and Dz_gear -- if those are inappropriate, I'd appreciate suggestions for better names. It will be necessary to modify the other UIUC configuration files to include some kind of gear support as well, or the planes will sink nose-first into the ground down to their CG's (it's actually quite funny to watch with an external view). Background ---------- As I frequently remind everyone here, I have no math background worth spitting at, so I will not even pretend to have done the hard stuff. The UIUC code uses a copy of a very old version of the LaRCsim c172_gear.c -- I wanted to update it with Tony Peden's excellent newer version, which includes differential braking among other goodies (the UIUC models don't support brakes, period). I copied the newer code into uiuc_aero.c, and it compiled and ran, but all of the planes ended up sitting on their tails with their noses in the air. Since Tony made his gear code nicely parameterized, I experimented with different values, and found that it wasn't too hard to balance the Twin Otter by moving the gear back a bit. At first, I used properties to set different values, but then I decided to integrate the whole thing properly into the UIUC configuration framework. Thanks to Tony Peden, who did the real modelling work -- I can take credit only for two or three hours of integration. It turns out that Tony's code is generalized enough to deal with a wide range of different gear structures -- I suspect that it will even work for the 747, when I get around to trying some values.
2001-03-29 03:16:25 +00:00
3/09/01 Added callout to UIUC gear function. (DPM)
2001-09-14 20:47:27 +00:00
6/18/01 Added call out to UIUC record routine (RD)
11/12/01 Changed from uiuc_init_aeromodel() to uiuc_initial_init(). (RD)
2/24/02 Added uiuc_network_routine() (GD)
2000-03-22 22:08:16 +00:00
----------------------------------------------------------------------------
CALLED BY:
----------------------------------------------------------------------------
CALLS TO:
----------------------------------------------------------------------------
INPUTS:
----------------------------------------------------------------------------
OUTPUTS:
--------------------------------------------------------------------------*/
#include <math.h>
#include "ls_types.h"
#include "ls_generic.h"
#include "ls_constants.h"
#include "ls_cockpit.h"
#include <FDM/UIUCModel/uiuc_wrapper.h>
void uiuc_aero_2_wrapper( SCALAR dt, int Initialize )
2000-03-22 22:08:16 +00:00
{
static int init = 0;
if (init==0)
{
init = -1;
uiuc_initial_init();
// uiuc_init_aeromodel();
2000-03-22 22:08:16 +00:00
}
uiuc_force_moment(dt);
}
void uiuc_engine_2_wrapper( SCALAR dt, int Initialize )
2000-03-22 22:08:16 +00:00
{
uiuc_engine_routine();
}
void uiuc_gear_2_wrapper ()
2000-03-22 22:08:16 +00:00
{
From: David Megginson <david@megginson.com> I have created a set of patches to provide configurable landing gear for the UIUC models. The patches (including four new files) are available at http://megginson.com/private/fgfs/uiuc-20010309.tar.gz A modified UIUC configuration file for the Twin Otter (DHC-6) is available at http://megginson.com/private/fgfs/aircraft.dat It should be possible to configure appropriate gear for all of the UIUC models now. As a bonus, the models also support braking, both absolute and differential, as well as nose-wheel steering (all of which are currently missing from the UIUC models) -- when you land, you don't have to keep rolling off the end of the runway anymore, and you don't have to bank to steer in a taxi. My sample configuration file contains absolutely bizarre, wild guesses, and many places that I didn't even bother to guess properly. The only actual data I had was the wing-span of the DHC-6 (65ft), which I used for positioning the wing tips. The wing-tips for this model actually work now -- I hit the aileron hard while accelerating for take-off, and the wingtip noticeably strikes the ground and bounces up (quite dramatic in external view using the DHC-6 model from Wolfram's site). Details ------- The UIUC models now support up to 16 gear points each where a gear point is anything in the aircraft that can come in contact with the ground, including the tail and wing-tips. I have added the following new fields to the UIUC configuration files, where <index> is an integer between 0 and 15, and <value> is a real number: gear <index> Dx_gear <value> # x offset from CG [ft] gear <index> Dy_gear <value> # y offset from CG [ft] gear <index> Dz_gear <value> # z offset from CG [ft] gear <index> cgear <value> # spring damping [lbs/ft/sec] gear <index> kgear <value> # springiness [lbs/ft] gear <index> muGear <value> # rolling coefficient gear <index> strutLength <value> # gear travel [ft] (not yet used) Most of these names were already pencilled into the UIUC documentation (as TODO items), but I had to make up Dx_gear, Dy_gear, and Dz_gear -- if those are inappropriate, I'd appreciate suggestions for better names. It will be necessary to modify the other UIUC configuration files to include some kind of gear support as well, or the planes will sink nose-first into the ground down to their CG's (it's actually quite funny to watch with an external view). Background ---------- As I frequently remind everyone here, I have no math background worth spitting at, so I will not even pretend to have done the hard stuff. The UIUC code uses a copy of a very old version of the LaRCsim c172_gear.c -- I wanted to update it with Tony Peden's excellent newer version, which includes differential braking among other goodies (the UIUC models don't support brakes, period). I copied the newer code into uiuc_aero.c, and it compiled and ran, but all of the planes ended up sitting on their tails with their noses in the air. Since Tony made his gear code nicely parameterized, I experimented with different values, and found that it wasn't too hard to balance the Twin Otter by moving the gear back a bit. At first, I used properties to set different values, but then I decided to integrate the whole thing properly into the UIUC configuration framework. Thanks to Tony Peden, who did the real modelling work -- I can take credit only for two or three hours of integration. It turns out that Tony's code is generalized enough to deal with a wide range of different gear structures -- I suspect that it will even work for the 747, when I get around to trying some values.
2001-03-29 03:16:25 +00:00
uiuc_gear_routine();
2000-03-22 22:08:16 +00:00
}
2001-09-14 20:47:27 +00:00
void uiuc_record_2_wrapper(SCALAR dt)
2001-09-14 20:47:27 +00:00
{
uiuc_record_routine(dt);
}
//void uiuc_network_2_wrapper()
//{
// uiuc_network_routine();
//}