JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
FGLGear Class Reference

Landing gear model. More...

#include <FGLGear.h>

+ Inheritance diagram for FGLGear:
+ Collaboration diagram for FGLGear:

Classes

struct  Inputs
 

Public Types

enum  BrakeGroup {
  bgNone =0, bgLeft, bgRight, bgCenter,
  bgNose, bgTail, bgNumBrakeGroups
}
 Brake grouping enumerators.
 
enum  ContactType { ctBOGEY, ctSTRUCTURE }
 Contact point type.
 
enum  DampType { dtLinear =0, dtSquare }
 Damping types.
 
enum  FrictionType { ftRoll =0, ftSide, ftDynamic }
 Friction types.
 
enum  ReportType { erNone =0, erTakeoff, erLand }
 Report type enumerators.
 
enum  SteerType { stSteer, stFixed, stCaster }
 Steering group membership enumerators.
 
- Public Types inherited from FGForce
enum  TransformType { tNone, tWindBody, tLocalBody, tCustom }
 
- Public Types inherited from FGJSBBase
enum  { eL = 1, eM, eN }
 Moments L, M, N.
 
enum  { eP = 1, eQ, eR }
 Rates P, Q, R.
 
enum  { eU = 1, eV, eW }
 Velocities U, V, W.
 
enum  { eX = 1, eY, eZ }
 Positions X, Y, Z.
 
enum  { ePhi = 1, eTht, ePsi }
 Euler angles Phi, Theta, Psi.
 
enum  { eDrag = 1, eSide, eLift }
 Stability axis forces, Drag, Side force, Lift.
 
enum  { eRoll = 1, ePitch, eYaw }
 Local frame orientation Roll, Pitch, Yaw.
 
enum  { eNorth = 1, eEast, eDown }
 Local frame position North, East, Down.
 
enum  { eLat = 1, eLong, eRad }
 Locations Radius, Latitude, Longitude.
 
enum  {
  inNone = 0, inDegrees, inRadians, inMeters,
  inFeet
}
 Conversion specifiers.
 

Public Member Functions

 FGLGear (Element *el, FGFDMExec *Executive, int number, const struct Inputs &input)
 Constructor. More...
 
 ~FGLGear ()
 Destructor.
 
void bind (void)
 
const FGColumnVector3GetBodyForces (FGSurface *surface=NULL)
 The Force vector for this gear. More...
 
FGColumnVector3 GetBodyLocation (void) const
 Gets the location of the gear in Body axes.
 
double GetBodyLocation (int idx) const
 
double GetBodyXForce (void)
 
double GetBodyYForce (void)
 
double GetBodyZForce (void)
 
int GetBrakeGroup (void) const
 
double GetCompForce (void) const
 Gets the gear compression force in pounds.
 
double GetCompLen (void) const
 Gets the current compressed length of the gear in feet.
 
double GetCompVel (void) const
 Gets the current gear compression velocity in ft/sec.
 
bool GetGearUnitDown (void) const
 
double GetGearUnitPos (void) const
 
bool GetGearUnitUp (void) const
 
const FGColumnVector3GetLocalGear (void) const
 
double GetLocalGear (int idx) const
 
const std::string & GetName (void) const
 Gets the name of the gear.
 
bool GetReport (void) const
 Get the console touchdown reporting feature. More...
 
bool GetRetractable (void) const
 
double GetstaticFCoeff (void) const
 
bool GetSteerable (void) const
 
double GetSteerAngleDeg (void) const
 
double GetSteerNorm (void) const
 
int GetSteerType (void) const
 
double GetWheelRollForce (void)
 
double GetWheelRollVel (void) const
 
double GetWheelSideForce (void)
 
double GetWheelSideVel (void) const
 
double GetWheelSlipAngle (void) const
 
double GetWheelVel (int axis) const
 
bool GetWOW (void) const
 Gets the Weight On Wheels flag value.
 
bool IsBogey (void) const
 
void ResetToIC (void)
 
void SetReport (bool flag)
 Set the console touchdown reporting feature. More...
 
void SetSteerAngleDeg (double angle)
 
void SetSteerCmd (double cmd)
 
void SetWOW (bool wow)
 Sets the weight-on-wheels flag.
 
- Public Member Functions inherited from FGForce
 FGForce (FGFDMExec *FDMExec)
 Constructor.
 
 FGForce (const FGForce &force)
 
 ~FGForce ()
 Destructor.
 
const FGColumnVector3GetActingLocation (void) const
 
double GetActingLocationX (void) const
 
double GetActingLocationY (void) const
 
double GetActingLocationZ (void) const
 
const FGColumnVector3GetAnglesToBody (void) const
 
double GetAnglesToBody (int axis) const
 
virtual const FGColumnVector3GetBodyForces (void)
 
double GetBodyXForce (void) const
 
double GetBodyYForce (void) const
 
double GetBodyZForce (void) const
 
const FGColumnVector3GetLocation (void) const
 
double GetLocationX (void) const
 
double GetLocationY (void) const
 
double GetLocationZ (void) const
 
const FGColumnVector3GetMoments (void) const
 
double GetPitch (void) const
 
TransformType GetTransformType (void) const
 
double GetYaw (void) const
 
void SetActingLocation (double x, double y, double z)
 Acting point of application. More...
 
void SetActingLocation (const FGColumnVector3 &vv)
 
double SetActingLocationX (double x)
 
double SetActingLocationY (double y)
 
double SetActingLocationZ (double z)
 
void SetAnglesToBody (double broll, double bpitch, double byaw)
 
void SetAnglesToBody (const FGColumnVector3 &vv)
 
void SetLocation (double x, double y, double z)
 
void SetLocation (const FGColumnVector3 &vv)
 
void SetLocationX (double x)
 
void SetLocationY (double y)
 
void SetLocationZ (double z)
 
void SetPitch (double pitch)
 
void SetTransformType (TransformType ii)
 
void SetYaw (double yaw)
 
const FGMatrix33Transform (void) const
 
void UpdateCustomTransformMatrix (void)
 
- Public Member Functions inherited from FGJSBBase
 FGJSBBase ()
 Constructor for FGJSBBase.
 
virtual ~FGJSBBase ()
 Destructor for FGJSBBase.
 
void disableHighLighting (void)
 Disables highlighting in the console output.
 
std::string GetVersion (void)
 Returns the version number of JSBSim. More...
 
void PutMessage (const Message &msg)
 Places a Message structure on the Message queue. More...
 
void PutMessage (const std::string &text)
 Creates a message with the given text and places it on the queue. More...
 
void PutMessage (const std::string &text, bool bVal)
 Creates a message with the given text and boolean value and places it on the queue. More...
 
void PutMessage (const std::string &text, int iVal)
 Creates a message with the given text and integer value and places it on the queue. More...
 
void PutMessage (const std::string &text, double dVal)
 Creates a message with the given text and double value and places it on the queue. More...
 
int SomeMessages (void)
 Reads the message on the queue (but does not delete it). More...
 
void ProcessMessage (void)
 Reads the message on the queue and removes it from the queue. More...
 
MessageProcessNextMessage (void)
 Reads the next message on the queue and removes it from the queue. More...
 

Public Attributes

const struct Inputsin
 

Additional Inherited Members

- Static Public Member Functions inherited from FGJSBBase
static double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit. More...
 
static double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin. More...
 
static double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine. More...
 
static double Constrain (double min, double value, double max)
 Constrain a value between a minimum and a maximum value.
 
static bool EqualToRoundoff (double a, double b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (float a, float b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (float a, double b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (double a, float b)
 Finite precision comparison. More...
 
static double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius. More...
 
static double FeetToMeters (double measure)
 Converts from feet to meters. More...
 
static double GaussianRandomNumber (void)
 
static double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius. More...
 
static double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit. More...
 
static double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine. More...
 
static double MachFromVcalibrated (double vcas, double p, double psl, double rhosl)
 Calculate the Mach number from the calibrated airspeed. More...
 
static double PitotTotalPressure (double mach, double p)
 Compute the total pressure in front of the Pitot tube. More...
 
static double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius. More...
 
static double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin. More...
 
static double sign (double num)
 
static double VcalibratedFromMach (double mach, double p, double psl, double rhosl)
 Calculate the calibrated airspeed from the Mach number. More...
 
- Static Public Attributes inherited from FGJSBBase
static short debug_lvl = 1
 
static char highint [5] = {27, '[', '1', 'm', '\0' }
 highlights text
 
static char halfint [5] = {27, '[', '2', 'm', '\0' }
 low intensity text
 
static char normint [6] = {27, '[', '2', '2', 'm', '\0' }
 normal intensity text
 
static char reset [5] = {27, '[', '0', 'm', '\0' }
 resets text properties
 
static char underon [5] = {27, '[', '4', 'm', '\0' }
 underlines text
 
static char underoff [6] = {27, '[', '2', '4', 'm', '\0' }
 underline off
 
static char fgblue [6] = {27, '[', '3', '4', 'm', '\0' }
 blue text
 
static char fgcyan [6] = {27, '[', '3', '6', 'm', '\0' }
 cyan text
 
static char fgred [6] = {27, '[', '3', '1', 'm', '\0' }
 red text
 
static char fggreen [6] = {27, '[', '3', '2', 'm', '\0' }
 green text
 
static char fgdef [6] = {27, '[', '3', '9', 'm', '\0' }
 default text
 
- Protected Types inherited from FGSurface
enum  ContactType { ctBOGEY, ctSTRUCTURE, ctGROUND }
 
- Protected Types inherited from FGForce
enum  TransformType { tNone, tWindBody, tLocalBody, tCustom }
 
- Protected Types inherited from FGJSBBase
enum  { eL = 1, eM, eN }
 Moments L, M, N.
 
enum  { eP = 1, eQ, eR }
 Rates P, Q, R.
 
enum  { eU = 1, eV, eW }
 Velocities U, V, W.
 
enum  { eX = 1, eY, eZ }
 Positions X, Y, Z.
 
enum  { ePhi = 1, eTht, ePsi }
 Euler angles Phi, Theta, Psi.
 
enum  { eDrag = 1, eSide, eLift }
 Stability axis forces, Drag, Side force, Lift.
 
enum  { eRoll = 1, ePitch, eYaw }
 Local frame orientation Roll, Pitch, Yaw.
 
enum  { eNorth = 1, eEast, eDown }
 Local frame position North, East, Down.
 
enum  { eLat = 1, eLong, eRad }
 Locations Radius, Latitude, Longitude.
 
enum  {
  inNone = 0, inDegrees, inRadians, inMeters,
  inFeet
}
 Conversion specifiers.
 
- Protected Member Functions inherited from FGSurface
 FGSurface (FGFDMExec *fdmex, int number=-1)
 Constructor.
 
 ~FGSurface ()
 Destructor.
 
void bind (void)
 
float GetBumpHeight ()
 Returns the height of the bump at the provided offset.
 
double GetBumpiness (void)
 Gets the normalized bumpiness factor associated with the surface.
 
double GetMaximumForce (void)
 Gets the maximum force of the surface area.
 
double GetRollingFFactor (void)
 Gets the rolling friction factor of the surface area.
 
bool GetSolid (void)
 Gets the surface is a solid flag value.
 
double GetStaticFFactor (void)
 Gets the static friction factor of the surface area.
 
std::string GetSurfaceStrings (std::string delimeter) const
 
std::string GetSurfaceValues (std::string delimeter) const
 
void resetValues (void)
 Reset all surface values to a default.
 
void SetBumpiness (double bump)
 Sets the normalized bumpiness factor associated with the surface.
 
void SetMaximumForce (double force)
 Sets the maximum force for the surface area.
 
void SetPosition (const double pt[3])
 Set the currect position for bumpiness calulcation.
 
void SetRollingFFactor (double friction)
 Sets the rolling friction factor of the surface area.
 
void SetSolid (bool solid)
 Sets the surface is a solid flag value.
 
void SetStaticFFactor (double friction)
 Sets the static friction factor of the surface area.
 
- Protected Member Functions inherited from FGForce
 FGForce (FGFDMExec *FDMExec)
 Constructor.
 
 FGForce (const FGForce &force)
 
 ~FGForce ()
 Destructor.
 
const FGColumnVector3GetActingLocation (void) const
 
double GetActingLocationX (void) const
 
double GetActingLocationY (void) const
 
double GetActingLocationZ (void) const
 
const FGColumnVector3GetAnglesToBody (void) const
 
double GetAnglesToBody (int axis) const
 
virtual const FGColumnVector3GetBodyForces (void)
 
double GetBodyXForce (void) const
 
double GetBodyYForce (void) const
 
double GetBodyZForce (void) const
 
const FGColumnVector3GetLocation (void) const
 
double GetLocationX (void) const
 
double GetLocationY (void) const
 
double GetLocationZ (void) const
 
const FGColumnVector3GetMoments (void) const
 
double GetPitch (void) const
 
TransformType GetTransformType (void) const
 
double GetYaw (void) const
 
void SetActingLocation (double x, double y, double z)
 Acting point of application. More...
 
void SetActingLocation (const FGColumnVector3 &vv)
 
double SetActingLocationX (double x)
 
double SetActingLocationY (double y)
 
double SetActingLocationZ (double z)
 
void SetAnglesToBody (double broll, double bpitch, double byaw)
 
void SetAnglesToBody (const FGColumnVector3 &vv)
 
void SetLocation (double x, double y, double z)
 
void SetLocation (const FGColumnVector3 &vv)
 
void SetLocationX (double x)
 
void SetLocationY (double y)
 
void SetLocationZ (double z)
 
void SetPitch (double pitch)
 
void SetTransformType (TransformType ii)
 
void SetYaw (double yaw)
 
const FGMatrix33Transform (void) const
 
void UpdateCustomTransformMatrix (void)
 
- Protected Member Functions inherited from FGJSBBase
void Debug (int)
 
 FGJSBBase ()
 Constructor for FGJSBBase.
 
virtual ~FGJSBBase ()
 Destructor for FGJSBBase.
 
void disableHighLighting (void)
 Disables highlighting in the console output.
 
std::string GetVersion (void)
 Returns the version number of JSBSim. More...
 
void PutMessage (const Message &msg)
 Places a Message structure on the Message queue. More...
 
void PutMessage (const std::string &text)
 Creates a message with the given text and places it on the queue. More...
 
void PutMessage (const std::string &text, bool bVal)
 Creates a message with the given text and boolean value and places it on the queue. More...
 
void PutMessage (const std::string &text, int iVal)
 Creates a message with the given text and integer value and places it on the queue. More...
 
void PutMessage (const std::string &text, double dVal)
 Creates a message with the given text and double value and places it on the queue. More...
 
int SomeMessages (void)
 Reads the message on the queue (but does not delete it). More...
 
void ProcessMessage (void)
 Reads the message on the queue and removes it from the queue. More...
 
MessageProcessNextMessage (void)
 Reads the next message on the queue and removes it from the queue. More...
 
- Static Protected Member Functions inherited from FGJSBBase
static std::string CreateIndexedPropertyName (const std::string &Property, int index)
 
static double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit. More...
 
static double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin. More...
 
static double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine. More...
 
static double Constrain (double min, double value, double max)
 Constrain a value between a minimum and a maximum value.
 
static bool EqualToRoundoff (double a, double b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (float a, float b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (float a, double b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (double a, float b)
 Finite precision comparison. More...
 
static double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius. More...
 
static double FeetToMeters (double measure)
 Converts from feet to meters. More...
 
static double GaussianRandomNumber (void)
 
static double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius. More...
 
static double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit. More...
 
static double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine. More...
 
static double MachFromVcalibrated (double vcas, double p, double psl, double rhosl)
 Calculate the Mach number from the calibrated airspeed. More...
 
static double PitotTotalPressure (double mach, double p)
 Compute the total pressure in front of the Pitot tube. More...
 
static double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius. More...
 
static double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin. More...
 
static double sign (double num)
 
static double VcalibratedFromMach (double mach, double p, double psl, double rhosl)
 Calculate the calibrated airspeed from the Mach number. More...
 
- Protected Attributes inherited from FGSurface
double bumpiness
 
double dynamicFCoeff
 
ContactType eSurfaceType
 
bool isSolid
 
double maximumForce
 
double rollingFFactor
 
double staticFCoeff
 
double staticFFactor
 
- Protected Attributes inherited from FGForce
FGFDMExecfdmex
 
FGMatrix33 mT
 
TransformType ttype
 
FGColumnVector3 vActingXYZn
 
FGColumnVector3 vFn
 
FGColumnVector3 vH
 
FGColumnVector3 vMn
 
FGColumnVector3 vOrient
 
FGColumnVector3 vXYZn
 
- Static Protected Attributes inherited from FGJSBBase
static const double degtorad = 0.017453292519943295769236907684886
 
static const double fpstokts = 1.0/ktstofps
 
static const double fttom = 0.3048
 
static int gaussian_random_number_phase = 0
 
static const double hptoftlbssec = 550.0
 
static const double in3tom3 = 1.638706E-5
 
static const double inchtoft = 0.08333333
 
static const double inhgtopa = 3386.38
 
static const std::string JSBSim_version = "1.0 " __DATE__ " " __TIME__
 
static const double kgtolb = 2.20462
 
static const double kgtoslug = 0.06852168
 
static const double ktstofps = 1.68781
 
static const double lbtoslug = 1.0/slugtolb
 
static Message localMsg
 
static const double m3toft3 = 1.0/(fttom*fttom*fttom)
 
static double Mair = 28.9645
 
static unsigned int messageId = 0
 
static std::queue< MessageMessages
 
static const std::string needed_cfg_version = "2.0"
 
static const double psftoinhg = 0.014138
 
static const double psftopa = 47.88
 
static const double radtodeg = 57.295779513082320876798154814105
 
static double Reng = 1716.56
 
static double Rstar = 1545.348
 
static const double SHRatio = 1.40
 
static const double slugtolb = 32.174049
 
static short debug_lvl = 1
 
static char highint [5] = {27, '[', '1', 'm', '\0' }
 highlights text
 
static char halfint [5] = {27, '[', '2', 'm', '\0' }
 low intensity text
 
static char normint [6] = {27, '[', '2', '2', 'm', '\0' }
 normal intensity text
 
static char reset [5] = {27, '[', '0', 'm', '\0' }
 resets text properties
 
static char underon [5] = {27, '[', '4', 'm', '\0' }
 underlines text
 
static char underoff [6] = {27, '[', '2', '4', 'm', '\0' }
 underline off
 
static char fgblue [6] = {27, '[', '3', '4', 'm', '\0' }
 blue text
 
static char fgcyan [6] = {27, '[', '3', '6', 'm', '\0' }
 cyan text
 
static char fgred [6] = {27, '[', '3', '1', 'm', '\0' }
 red text
 
static char fggreen [6] = {27, '[', '3', '2', 'm', '\0' }
 green text
 
static char fgdef [6] = {27, '[', '3', '9', 'm', '\0' }
 default text
 

Detailed Description

Landing gear model.

Calculates forces and moments due to landing gear reactions. This is done in several steps, and is dependent on what kind of gear is being modeled. Here are the parameters that can be specified in the config file for modeling landing gear:

Physical Characteristics

  1. X, Y, Z location, in inches in structural coordinate frame
  2. Spring constant, in lbs/ft
  3. Damping coefficient, in lbs/ft/sec
  4. Dynamic Friction Coefficient
  5. Static Friction Coefficient

Operational Properties

  1. Name
  2. Brake Group Membership {one of LEFT | CENTER | RIGHT | NOSE | TAIL | NONE}
  3. Max Steer Angle, in degrees

Algorithm and Approach to Modeling

  1. Find the location of the uncompressed landing gear relative to the CG of the aircraft. Remember, the structural coordinate frame that the aircraft is defined in is: X positive towards the tail, Y positive out the right side, Z positive upwards. The locations of the various parts are given in inches in the config file.
  2. The vector giving the location of the gear (relative to the cg) is rotated 180 degrees about the Y axis to put the coordinates in body frame (X positive forwards, Y positive out the right side, Z positive downwards, with the origin at the cg). The lengths are also now given in feet.
  3. The new gear location is now transformed to the local coordinate frame using the body-to-local matrix. (Mb2l).
  4. Knowing the location of the center of gravity relative to the ground (height above ground level or AGL) now enables gear deflection to be calculated. The gear compression value is the local frame gear Z location value minus the height AGL. [Currently, we make the assumption that the gear is oriented - and the deflection occurs in - the Z axis only. Additionally, the vector to the landing gear is currently not modified - which would (correctly) move the point of contact to the actual compressed-gear point of contact. Eventually, articulated gear may be modeled, but initially an effort must be made to model a generic system.] As an example, say the aircraft left main gear location (in local coordinates) is Z = 3 feet (positive) and the height AGL is 2 feet. This tells us that the gear is compressed 1 foot.
  5. If the gear is compressed, a Weight-On-Wheels (WOW) flag is set.
  6. With the compression length calculated, the compression velocity may now be calculated. This will be used to determine the damping force in the strut. The aircraft rotational rate is multiplied by the vector to the wheel to get a wheel velocity in body frame. That velocity vector is then transformed into the local coordinate frame.
  7. The aircraft cg velocity in the local frame is added to the just-calculated wheel velocity (due to rotation) to get a total wheel velocity in the local frame.
  8. The compression speed is the Z-component of the vector.
  9. With the wheel velocity vector no longer needed, it is normalized and multiplied by a -1 to reverse it. This will be used in the friction force calculation.
  10. Since the friction force takes place solely in the runway plane, the Z coordinate of the normalized wheel velocity vector is set to zero.
  11. The gear deflection force (the force on the aircraft acting along the local frame Z axis) is now calculated given the spring and damper coefficients, and the gear deflection speed and stroke length. Keep in mind that gear forces always act in the negative direction (in both local and body frames), and are not capable of generating a force in the positive sense (one that would attract the aircraft to the ground). So, the gear forces are always negative - they are limited to values of zero or less. The gear force is simply the negative of the sum of the spring compression length times the spring coefficient and the gear velocity times the damping coefficient.
  12. The lateral/directional force acting on the aircraft through the landing

    gear (along the local frame X and Y axes) is calculated next. First, the friction coefficient is multiplied by the recently calculated Z-force. This is the friction force. It must be given direction in addition to magnitude. We want the components in the local frame X and Y axes. From step 9, above, the conditioned wheel velocity vector is taken and the X and Y parts are multiplied by the friction force to get the X and Y components of friction.

  13. The wheel force in local frame is next converted to body frame.
  14. The moment due to the gear force is calculated by multiplying r x F (radius to wheel crossed into the wheel force). Both of these operands are in body frame.

Configuration File Format:

<contact type="{BOGEY | STRUCTURE}" name="{string}">
<location unit="{IN | M}">
<x> {number} </x>
<y> {number} </y>
<z> {number} </z>
</location>
<orientation unit="{RAD | DEG}">
<pitch> {number} </pitch>
<roll> {number} </roll>
<yaw> {number} </yaw>
</orientation>
<static_friction> {number} </static_friction>
<dynamic_friction> {number} </dynamic_friction>
<rolling_friction> {number} </rolling_friction>
<spring_coeff unit="{LBS/FT | N/M}"> {number} </spring_coeff>
<damping_coeff [type="SQUARE"] unit="{LBS/FT/SEC | N/M/SEC}"> {number} </damping_coeff>
<damping_coeff_rebound [type="SQUARE"] unit="{LBS/FT/SEC | N/M/SEC}"> {number} </damping_coeff_rebound>
<max_steer unit="DEG"> {number | 0 | 360} </max_steer>
<brake_group> {NONE | LEFT | RIGHT | CENTER | NOSE | TAIL} </brake_group>
<retractable>{0 | 1}</retractable>
<table type="{CORNERING_COEFF}">
</table>
</contact>
Author
Jon S. Berndt
Version
Id
FGLGear.h,v 1.65 2016/05/16 18:19:57 bcoconni Exp
See also
Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at NASA-Ames", NASA CR-2497, January 1975
Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics", Wiley & Sons, 1979 ISBN 0-471-03032-5
W. A. Ragsdale, "A Generic Landing Gear Dynamics Model for LASRS++", AIAA-2000-4303

Definition at line 194 of file FGLGear.h.

Constructor & Destructor Documentation

◆ FGLGear()

FGLGear ( Element el,
FGFDMExec Executive,
int  number,
const struct Inputs input 
)

Constructor.

Parameters
ela pointer to the XML element that contains the CONTACT info.
Executivea pointer to the parent executive object
numberinteger identifier for this instance of FGLGear

Definition at line 76 of file FGLGear.cpp.

76  :
77  FGSurface(fdmex, number),
78  FGForce(fdmex),
79  in(inputs),
80  GearNumber(number),
81  SteerAngle(0.0),
82  Castered(false),
83  StaticFriction(false),
84  eSteerType(stSteer)
85 {
86  kSpring = bDamp = bDampRebound = dynamicFCoeff = staticFCoeff = rollingFCoeff = maxSteerAngle = 0;
87  isRetractable = false;
88  eDampType = dtLinear;
89  eDampTypeRebound = dtLinear;
90 
91  name = el->GetAttributeValue("name");
92  string sContactType = el->GetAttributeValue("type");
93  if (sContactType == "BOGEY") {
94  eContactType = ctBOGEY;
95  } else if (sContactType == "STRUCTURE") {
96  eContactType = ctSTRUCTURE;
97  } else {
98  // Unknown contact point types will be treated as STRUCTURE.
99  eContactType = ctSTRUCTURE;
100  }
101 
102  // Default values for structural contact points
103  if (eContactType == ctSTRUCTURE) {
104  kSpring = in.EmptyWeight;
105  bDamp = kSpring;
106  bDampRebound = kSpring * 10;
107  staticFCoeff = 1.0;
108  dynamicFCoeff = 1.0;
109  }
110 
111  PropertyManager = fdmex->GetPropertyManager();
112 
113  fStrutForce = 0;
114  Element* strutForce = el->FindElement("strut_force");
115  if (strutForce) {
116  Element* springFunc = strutForce->FindElement("function");
117  fStrutForce = new FGFunction(PropertyManager, springFunc);
118  }
119  else {
120  if (el->FindElement("spring_coeff"))
121  kSpring = el->FindElementValueAsNumberConvertTo("spring_coeff", "LBS/FT");
122  if (el->FindElement("damping_coeff")) {
123  Element* dampCoeff = el->FindElement("damping_coeff");
124  if (dampCoeff->GetAttributeValue("type") == "SQUARE") {
125  eDampType = dtSquare;
126  bDamp = el->FindElementValueAsNumberConvertTo("damping_coeff", "LBS/FT2/SEC2");
127  } else {
128  bDamp = el->FindElementValueAsNumberConvertTo("damping_coeff", "LBS/FT/SEC");
129  }
130  }
131 
132  if (el->FindElement("damping_coeff_rebound")) {
133  Element* dampCoeffRebound = el->FindElement("damping_coeff_rebound");
134  if (dampCoeffRebound->GetAttributeValue("type") == "SQUARE") {
135  eDampTypeRebound = dtSquare;
136  bDampRebound = el->FindElementValueAsNumberConvertTo("damping_coeff_rebound", "LBS/FT2/SEC2");
137  } else {
138  bDampRebound = el->FindElementValueAsNumberConvertTo("damping_coeff_rebound", "LBS/FT/SEC");
139  }
140  } else {
141  bDampRebound = bDamp;
142  eDampTypeRebound = eDampType;
143  }
144  }
145 
146  if (el->FindElement("dynamic_friction"))
147  dynamicFCoeff = el->FindElementValueAsNumber("dynamic_friction");
148  if (el->FindElement("static_friction"))
149  staticFCoeff = el->FindElementValueAsNumber("static_friction");
150  if (el->FindElement("rolling_friction"))
151  rollingFCoeff = el->FindElementValueAsNumber("rolling_friction");
152  if (el->FindElement("retractable"))
153  isRetractable = ((unsigned int)el->FindElementValueAsNumber("retractable"))>0.0?true:false;
154 
155  if (el->FindElement("max_steer"))
156  maxSteerAngle = el->FindElementValueAsNumberConvertTo("max_steer", "DEG");
157 
158  Element* castered_el = el->FindElement("castered");
159 
160  if ((maxSteerAngle == 360 && !castered_el)
161  || (castered_el && castered_el->GetDataAsNumber() != 0.0)) {
162  eSteerType = stCaster;
163  Castered = true;
164  }
165  else if (maxSteerAngle == 0.0) {
166  eSteerType = stFixed;
167  }
168  else
169  eSteerType = stSteer;
170 
171  GroundReactions = fdmex->GetGroundReactions();
172 
173  ForceY_Table = 0;
174  Element* force_table = el->FindElement("table");
175  while (force_table) {
176  string force_type = force_table->GetAttributeValue("type");
177  if (force_type == "CORNERING_COEFF") {
178  ForceY_Table = new FGTable(PropertyManager, force_table);
179  break;
180  } else {
181  cerr << "Undefined force table for " << name << " contact point" << endl;
182  }
183  force_table = el->FindNextElement("table");
184  }
185 
186  Element* element = el->FindElement("location");
187  if (element) vXYZn = element->FindElementTripletConvertTo("IN");
188  else {cerr << "No location given for contact " << name << endl; exit(-1);}
189  SetTransformType(FGForce::tCustom);
190 
191  element = el->FindElement("orientation");
192  if (element && (eContactType == ctBOGEY)) {
193  FGQuaternion quatFromEuler(element->FindElementTripletConvertTo("RAD"));
194 
195  mTGear = quatFromEuler.GetT();
196  }
197  else {
198  mTGear(1,1) = 1.;
199  mTGear(2,2) = 1.;
200  mTGear(3,3) = 1.;
201  }
202 
203  string sBrakeGroup = el->FindElementValue("brake_group");
204 
205  if (sBrakeGroup == "LEFT" ) eBrakeGrp = bgLeft;
206  else if (sBrakeGroup == "RIGHT" ) eBrakeGrp = bgRight;
207  else if (sBrakeGroup == "CENTER") eBrakeGrp = bgCenter;
208  else if (sBrakeGroup == "NOSE" ) eBrakeGrp = bgCenter; // Nose brake is not supported by FGFCS
209  else if (sBrakeGroup == "TAIL" ) eBrakeGrp = bgCenter; // Tail brake is not supported by FGFCS
210  else if (sBrakeGroup == "NONE" ) eBrakeGrp = bgNone;
211  else if (sBrakeGroup.empty() ) eBrakeGrp = bgNone;
212  else {
213  cerr << "Improper braking group specification in config file: "
214  << sBrakeGroup << " is undefined." << endl;
215  }
216 
217 // Add some AI here to determine if gear is located properly according to its
218 // brake group type ??
219 
220  useFCSGearPos = false;
221  ReportEnable = true;
222  TakeoffReported = LandingReported = false;
223 
224  // Set Pacejka terms
225 
226  Stiffness = 0.06;
227  Shape = 2.8;
228  Peak = staticFCoeff;
229  Curvature = 1.03;
230 
231  ResetToIC();
232 
233  Debug(0);
234 }
FGPropertyManager * GetPropertyManager(void)
Returns a pointer to the property manager object.
Definition: FGFDMExec.cpp:1099
FGSurface(FGFDMExec *fdmex, int number=-1)
Constructor.
Definition: FGSurface.cpp:59
FGForce(FGFDMExec *FDMExec)
Constructor.
Definition: FGForce.cpp:61
FGGroundReactions * GetGroundReactions(void)
Returns the FGGroundReactions pointer.
Definition: FGFDMExec.h:361
+ Here is the call graph for this function:

Member Function Documentation

◆ GetBodyForces()

const FGColumnVector3 & GetBodyForces ( FGSurface surface = NULL)

The Force vector for this gear.

Parameters
surfaceanother surface to interact with, set to NULL for none.

Definition at line 279 of file FGLGear.cpp.

280 {
281  double gearPos = 1.0;
282 
283  vFn.InitMatrix();
284 
285  if (isRetractable) gearPos = GetGearUnitPos();
286 
287  if (gearPos > 0.99) { // Gear DOWN
288  FGColumnVector3 normal, terrainVel, dummy;
289  FGLocation gearLoc, contact;
290  FGColumnVector3 vWhlBodyVec = Ts2b * (vXYZn - in.vXYZcg);
291 
292  vLocalGear = in.Tb2l * vWhlBodyVec; // Get local frame wheel location
293  gearLoc = in.Location.LocalToLocation(vLocalGear);
294 
295  // Compute the height of the theoretical location of the wheel (if strut is
296  // not compressed) with respect to the ground level
297  double height = gearLoc.GetContactPoint(contact, normal, terrainVel, dummy);
298 
299  // Does this surface contact point interact with another surface?
300  if (surface) {
301  height -= (*surface).GetBumpHeight();
302  staticFFactor = (*surface).GetStaticFFactor();
303  rollingFFactor = (*surface).GetRollingFFactor();
304  maximumForce = (*surface).GetMaximumForce();
305  isSolid = (*surface).GetSolid();
306  }
307 
308  if (height < 0.0) {
309  WOW = isSolid;
310  vGroundNormal = in.Tec2b * normal;
311 
312  // The height returned by GetGroundCallback() is the AGL and is expressed
313  // in the Z direction of the local coordinate frame. We now need to transform
314  // this height in actual compression of the strut (BOGEY) or in the normal
315  // direction to the ground (STRUCTURE)
316  double normalZ = (in.Tec2l*normal)(eZ);
317  double LGearProj = -(mTGear.Transposed() * vGroundNormal)(eZ);
318  FGColumnVector3 vWhlDisplVec;
319 
320  // The following equations use the vector to the tire contact patch
321  // including the strut compression.
322  switch(eContactType) {
323  case ctBOGEY:
324  if (isSolid) {
325  compressLength = LGearProj > 0.0 ? height * normalZ / LGearProj : 0.0;
326  vWhlDisplVec = mTGear * FGColumnVector3(0., 0., -compressLength);
327  } else {
328  // Gears don't (or hardly) compress in liquids
329  compressLength = 0.0;
330  vWhlDisplVec = 0.0 * vGroundNormal;
331  }
332  break;
333  case ctSTRUCTURE:
334  compressLength = height * normalZ / DotProduct(normal, normal);
335  vWhlDisplVec = compressLength * vGroundNormal;
336  break;
337  }
338 
339  FGColumnVector3 vWhlContactVec = vWhlBodyVec + vWhlDisplVec;
340  vActingXYZn = vXYZn + Tb2s * vWhlDisplVec;
341  FGColumnVector3 vBodyWhlVel = in.PQR * vWhlContactVec;
342  vBodyWhlVel += in.UVW - in.Tec2b * terrainVel;
343 
344  if (isSolid) {
345  vWhlVelVec = mTGear.Transposed() * vBodyWhlVel;
346  } else {
347  // wheels don't spin up in liquids: let wheel spin down slowly
348  vWhlVelVec(eX) -= 13.0 * in.TotalDeltaT;
349  if (vWhlVelVec(eX) < 0.0) vWhlVelVec(eX) = 0.0;
350  }
351 
352  InitializeReporting();
353  ComputeSteeringAngle();
354  ComputeGroundFrame();
355 
356  vGroundWhlVel = mT.Transposed() * vBodyWhlVel;
357 
358  if (fdmex->GetTrimStatus())
359  compressSpeed = 0.0; // Steady state is sought during trimming
360  else {
361  compressSpeed = -vGroundWhlVel(eZ);
362  if (eContactType == ctBOGEY)
363  compressSpeed /= LGearProj;
364  }
365 
366  ComputeVerticalStrutForce();
367 
368  // Compute the friction coefficients in the wheel ground plane.
369  if (eContactType == ctBOGEY) {
370  ComputeSlipAngle();
371  ComputeBrakeForceCoefficient();
372  ComputeSideForceCoefficient();
373  }
374 
375  // Prepare the Jacobians and the Lagrange multipliers for later friction
376  // forces calculations.
377  ComputeJacobian(vWhlContactVec);
378 
379  } else { // Gear is NOT compressed
380 
381  WOW = false;
382  compressLength = 0.0;
383  compressSpeed = 0.0;
384  WheelSlip = 0.0;
385  StrutForce = 0.0;
386 
387  LMultiplier[ftRoll].value = 0.0;
388  LMultiplier[ftSide].value = 0.0;
389  LMultiplier[ftDynamic].value = 0.0;
390 
391  // Let wheel spin down slowly
392  vWhlVelVec(eX) -= 13.0 * in.TotalDeltaT;
393  if (vWhlVelVec(eX) < 0.0) vWhlVelVec(eX) = 0.0;
394 
395  // Return to neutral position between 1.0 and 0.8 gear pos.
396  SteerAngle *= max(gearPos-0.8, 0.0)/0.2;
397 
398  ResetReporting();
399  }
400 
401  } else if (gearPos < 0.01) { // Gear UP
402 
403  WOW = false;
404  vWhlVelVec.InitMatrix();
405  }
406 
407  if (!fdmex->GetTrimStatus()) {
408  ReportTakeoffOrLanding();
409 
410  // Require both WOW and LastWOW to be true before checking crash conditions
411  // to allow the WOW flag to be used in terminating a scripted run.
412  if (WOW && lastWOW) CrashDetect();
413 
414  lastWOW = WOW;
415  }
416 
417  return FGForce::GetBodyForces();
418 }
double GetContactPoint(FGLocation &contact, FGColumnVector3 &normal, FGColumnVector3 &v, FGColumnVector3 &w) const
Get terrain contact point information below the current location.
Definition: FGLocation.h:378
FGLocation LocalToLocation(const FGColumnVector3 &lvec) const
Conversion from Local frame coordinates to a location in the earth centered and fixed frame...
Definition: FGLocation.h:467
FGMatrix33 Transposed(void) const
Transposed matrix.
Definition: FGMatrix33.h:243
+ Here is the call graph for this function:

◆ GetReport()

bool GetReport ( void  ) const
inline

Get the console touchdown reporting feature.

Returns
true if reporting is turned on

Definition at line 275 of file FGLGear.h.

275 { return ReportEnable; }

◆ SetReport()

void SetReport ( bool  flag)
inline

Set the console touchdown reporting feature.

Parameters
flagtrue turns on touchdown reporting, false turns it off

Definition at line 272 of file FGLGear.h.

272 { ReportEnable = flag; }
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: