JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
FGLGear Class Reference

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 for <contact> Section:

<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 name="{CORNERING_COEFF}" type="internal">
<tableData>
{cornering parameters}
</tableData>
</table>
</contact>
Author
Jon S. Berndt
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 190 of file FGLGear.h.

#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...
 
double GetBodyLocation (int idx) const
 
FGColumnVector3 GetBodyLocation (void) const
 Gets the location of the gear in Body axes.
 
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
 
double GetLocalGear (int idx) const
 
const FGColumnVector3GetLocalGear (void) 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 (const FGForce &force)
 
 FGForce (FGFDMExec *FDMExec)
 Constructor.
 
virtual ~FGForce ()
 Destructor.
 
const FGColumnVector3GetActingLocation (void) const
 
double GetActingLocationX (void) const
 
double GetActingLocationY (void) const
 
double GetActingLocationZ (void) const
 
double GetAnglesToBody (int axis) const
 
const FGColumnVector3GetAnglesToBody (void) 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 (const FGColumnVector3 &vv)
 
void SetActingLocation (double x, double y, double z)
 Acting point of application. More...
 
double SetActingLocationX (double x)
 
double SetActingLocationY (double y)
 
double SetActingLocationZ (double z)
 
void SetAnglesToBody (const FGColumnVector3 &vv)
 
void SetAnglesToBody (double broll, double bpitch, double byaw)
 
void SetLocation (const FGColumnVector3 &vv)
 
void SetLocation (double x, double y, double z)
 
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 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) const
 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...
 
void disableHighLighting (void)
 Disables highlighting in the console output.
 

Public Attributes

const struct Inputsin
 

Additional Inherited Members

- Static Public Member Functions inherited from FGJSBBase
static const std::string & GetVersion (void)
 Returns the version number of JSBSim. More...
 
static constexpr double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit. More...
 
static constexpr double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine. More...
 
static constexpr double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius. More...
 
static constexpr double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine. More...
 
static constexpr double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin. More...
 
static constexpr double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius. More...
 
static constexpr double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit. More...
 
static constexpr double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin. More...
 
static constexpr double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius. More...
 
static constexpr double FeetToMeters (double measure)
 Converts from feet to meters. More...
 
static double PitotTotalPressure (double mach, double p)
 Compute the total pressure in front of the Pitot tube. More...
 
static double MachFromImpactPressure (double qc, double p)
 Compute the Mach number from the differential pressure (qc) and the static pressure. More...
 
static double VcalibratedFromMach (double mach, double p)
 Calculate the calibrated airspeed from the Mach number. More...
 
static double MachFromVcalibrated (double vcas, double p)
 Calculate the Mach number from the calibrated airspeed.Based on the formulas in the US Air Force Aircraft Performance Flight Testing Manual (AFFTC-TIH-99-01). More...
 
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 constexpr double Constrain (double min, double value, double max)
 Constrain a value between a minimum and a maximum value.
 
static constexpr double sign (double num)
 
static double GaussianRandomNumber (void)
 
- Static Public Attributes inherited from FGJSBBase
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
 
static short debug_lvl = 1
 
- 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 (const FGForce &force)
 
 FGForce (FGFDMExec *FDMExec)
 Constructor.
 
virtual ~FGForce ()
 Destructor.
 
const FGColumnVector3GetActingLocation (void) const
 
double GetActingLocationX (void) const
 
double GetActingLocationY (void) const
 
double GetActingLocationZ (void) const
 
double GetAnglesToBody (int axis) const
 
const FGColumnVector3GetAnglesToBody (void) 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 (const FGColumnVector3 &vv)
 
void SetActingLocation (double x, double y, double z)
 Acting point of application. More...
 
double SetActingLocationX (double x)
 
double SetActingLocationY (double y)
 
double SetActingLocationZ (double z)
 
void SetAnglesToBody (const FGColumnVector3 &vv)
 
void SetAnglesToBody (double broll, double bpitch, double byaw)
 
void SetLocation (const FGColumnVector3 &vv)
 
void SetLocation (double x, double y, double z)
 
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
 FGJSBBase ()
 Constructor for FGJSBBase.
 
virtual ~FGJSBBase ()
 Destructor for FGJSBBase.
 
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) const
 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...
 
void disableHighLighting (void)
 Disables highlighting in the console output.
 
- Static Protected Member Functions inherited from FGJSBBase
static std::string CreateIndexedPropertyName (const std::string &Property, int index)
 
static const std::string & GetVersion (void)
 Returns the version number of JSBSim. More...
 
static constexpr double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit. More...
 
static constexpr double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine. More...
 
static constexpr double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius. More...
 
static constexpr double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine. More...
 
static constexpr double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin. More...
 
static constexpr double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius. More...
 
static constexpr double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit. More...
 
static constexpr double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin. More...
 
static constexpr double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius. More...
 
static constexpr double FeetToMeters (double measure)
 Converts from feet to meters. More...
 
static double PitotTotalPressure (double mach, double p)
 Compute the total pressure in front of the Pitot tube. More...
 
static double MachFromImpactPressure (double qc, double p)
 Compute the Mach number from the differential pressure (qc) and the static pressure. More...
 
static double VcalibratedFromMach (double mach, double p)
 Calculate the calibrated airspeed from the Mach number. More...
 
static double MachFromVcalibrated (double vcas, double p)
 Calculate the Mach number from the calibrated airspeed.Based on the formulas in the US Air Force Aircraft Performance Flight Testing Manual (AFFTC-TIH-99-01). More...
 
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 constexpr double Constrain (double min, double value, double max)
 Constrain a value between a minimum and a maximum value.
 
static constexpr double sign (double num)
 
static double GaussianRandomNumber (void)
 
- 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
 
FGMassBalanceMassBalance
 
FGMatrix33 mT
 
TransformType ttype
 
FGColumnVector3 vActingXYZn
 
FGColumnVector3 vFn
 
FGColumnVector3 vMn
 
FGColumnVector3 vOrient
 
FGColumnVector3 vXYZn
 
- Static Protected Attributes inherited from FGJSBBase
static Message localMsg
 
static std::queue< MessageMessages
 
static unsigned int messageId = 0
 
static constexpr double radtodeg = 180. / M_PI
 
static constexpr double degtorad = M_PI / 180.
 
static constexpr double hptoftlbssec = 550.0
 
static constexpr double psftoinhg = 0.014138
 
static constexpr double psftopa = 47.88
 
static constexpr double ktstofps = 1.68781
 
static constexpr double fpstokts = 1.0 / ktstofps
 
static constexpr double inchtoft = 1.0/12.0
 
static constexpr double fttom = 0.3048
 
static constexpr double m3toft3 = 1.0/(fttom*fttom*fttom)
 
static constexpr double in3tom3 = inchtoft*inchtoft*inchtoft/m3toft3
 
static constexpr double inhgtopa = 3386.38
 
static constexpr double slugtolb = 32.174049
 Note that definition of lbtoslug by the inverse of slugtolb and not to a different constant you can also get from some tables will make lbtoslug*slugtolb == 1 up to the magnitude of roundoff. More...
 
static constexpr double lbtoslug = 1.0/slugtolb
 
static constexpr double kgtolb = 2.20462
 
static constexpr double kgtoslug = 0.06852168
 
static const std::string needed_cfg_version = "2.0"
 
static const std::string JSBSim_version = JSBSIM_VERSION " " __DATE__ " " __TIME__
 
static int gaussian_random_number_phase = 0
 
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
 
static short debug_lvl = 1
 

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 71 of file FGLGear.cpp.

71  :
72  FGSurface(fdmex, number),
73  FGForce(fdmex),
74  in(inputs),
75  GearNumber(number),
76  SteerAngle(0.0),
77  Castered(false),
78  StaticFriction(false),
79  eSteerType(stSteer)
80 {
81  kSpring = bDamp = bDampRebound = dynamicFCoeff = staticFCoeff = rollingFCoeff = maxSteerAngle = 0;
82  isRetractable = false;
83  eDampType = dtLinear;
84  eDampTypeRebound = dtLinear;
85 
86  name = el->GetAttributeValue("name");
87  string sContactType = el->GetAttributeValue("type");
88  if (sContactType == "BOGEY") {
89  eContactType = ctBOGEY;
90  } else if (sContactType == "STRUCTURE") {
91  eContactType = ctSTRUCTURE;
92  } else {
93  // Unknown contact point types will be treated as STRUCTURE.
94  eContactType = ctSTRUCTURE;
95  }
96 
97  // Default values for structural contact points
98  if (eContactType == ctSTRUCTURE) {
99  kSpring = in.EmptyWeight;
100  bDamp = kSpring;
101  bDampRebound = kSpring * 10;
102  staticFCoeff = 1.0;
103  dynamicFCoeff = 1.0;
104  }
105 
106  PropertyManager = fdmex->GetPropertyManager();
107 
108  fStrutForce = 0;
109  Element* strutForce = el->FindElement("strut_force");
110  if (strutForce) {
111  Element* springFunc = strutForce->FindElement("function");
112  fStrutForce = new FGFunction(fdmex, springFunc);
113  }
114  else {
115  if (el->FindElement("spring_coeff"))
116  kSpring = el->FindElementValueAsNumberConvertTo("spring_coeff", "LBS/FT");
117  if (el->FindElement("damping_coeff")) {
118  Element* dampCoeff = el->FindElement("damping_coeff");
119  if (dampCoeff->GetAttributeValue("type") == "SQUARE") {
120  eDampType = dtSquare;
121  bDamp = el->FindElementValueAsNumberConvertTo("damping_coeff", "LBS/FT2/SEC2");
122  } else {
123  bDamp = el->FindElementValueAsNumberConvertTo("damping_coeff", "LBS/FT/SEC");
124  }
125  }
126 
127  if (el->FindElement("damping_coeff_rebound")) {
128  Element* dampCoeffRebound = el->FindElement("damping_coeff_rebound");
129  if (dampCoeffRebound->GetAttributeValue("type") == "SQUARE") {
130  eDampTypeRebound = dtSquare;
131  bDampRebound = el->FindElementValueAsNumberConvertTo("damping_coeff_rebound", "LBS/FT2/SEC2");
132  } else {
133  bDampRebound = el->FindElementValueAsNumberConvertTo("damping_coeff_rebound", "LBS/FT/SEC");
134  }
135  } else {
136  bDampRebound = bDamp;
137  eDampTypeRebound = eDampType;
138  }
139  }
140 
141  if (el->FindElement("dynamic_friction"))
142  dynamicFCoeff = el->FindElementValueAsNumber("dynamic_friction");
143  if (el->FindElement("static_friction"))
144  staticFCoeff = el->FindElementValueAsNumber("static_friction");
145  if (el->FindElement("rolling_friction"))
146  rollingFCoeff = el->FindElementValueAsNumber("rolling_friction");
147  if (el->FindElement("retractable"))
148  isRetractable = ((unsigned int)el->FindElementValueAsNumber("retractable"))>0.0?true:false;
149 
150  if (el->FindElement("max_steer"))
151  maxSteerAngle = el->FindElementValueAsNumberConvertTo("max_steer", "DEG");
152 
153  Element* castered_el = el->FindElement("castered");
154 
155  if ((maxSteerAngle == 360 && !castered_el)
156  || (castered_el && castered_el->GetDataAsNumber() != 0.0)) {
157  eSteerType = stCaster;
158  Castered = true;
159  }
160  else if (maxSteerAngle == 0.0) {
161  eSteerType = stFixed;
162  }
163  else
164  eSteerType = stSteer;
165 
166  GroundReactions = fdmex->GetGroundReactions();
167 
168  ForceY_Table = 0;
169  Element* force_table = el->FindElement("table");
170  while (force_table) {
171  string force_type = force_table->GetAttributeValue("name");
172  if (force_type == "CORNERING_COEFF") {
173  ForceY_Table = new FGTable(PropertyManager, force_table);
174  break;
175  } else {
176  cerr << "Undefined force table for " << name << " contact point" << endl;
177  }
178  force_table = el->FindNextElement("table");
179  }
180 
181  Element* element = el->FindElement("location");
182  if (element) vXYZn = element->FindElementTripletConvertTo("IN");
183  else {
184  stringstream s;
185  s << "No location given for contact " << name;
186  cerr << endl << s.str() << endl;
187  throw BaseException(s.str());
188  }
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 }
+ 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 = fdmex->GetInertial()->GetContactPoint(gearLoc, contact,
298  normal, terrainVel,
299  dummy);
300 
301  // Does this surface contact point interact with another surface?
302  if (surface) {
303  if (!fdmex->GetTrimStatus())
304  height -= (*surface).GetBumpHeight();
305  staticFFactor = (*surface).GetStaticFFactor();
306  rollingFFactor = (*surface).GetRollingFFactor();
307  maximumForce = (*surface).GetMaximumForce();
308  isSolid = (*surface).GetSolid();
309  }
310 
311  FGColumnVector3 vWhlDisplVec;
312  double LGearProj = 1.0;
313 
314  if (height < 0.0) {
315  WOW = true;
316  vGroundNormal = in.Tec2b * normal;
317 
318  // The height returned by GetGroundCallback() is the AGL and is expressed
319  // in the Z direction of the local coordinate frame. We now need to
320  // transform this height in actual compression of the strut (BOGEY) or in
321  // the normal direction to the ground (STRUCTURE)
322  double normalZ = (in.Tec2l*normal)(eZ);
323  LGearProj = -(mTGear.Transposed() * vGroundNormal)(eZ);
324 
325  // The following equations use the vector to the tire contact patch
326  // including the strut compression.
327  switch(eContactType) {
328  case ctBOGEY:
329  if (isSolid) {
330  compressLength = LGearProj > 0.0 ? height * normalZ / LGearProj : 0.0;
331  vWhlDisplVec = mTGear * FGColumnVector3(0., 0., -compressLength);
332  } else {
333  // Gears don't (or hardly) compress in liquids
334  WOW = false;
335  }
336  break;
337  case ctSTRUCTURE:
338  compressLength = height * normalZ / DotProduct(normal, normal);
339  vWhlDisplVec = compressLength * vGroundNormal;
340  break;
341  }
342  }
343  else
344  WOW = false;
345 
346  if (WOW) {
347  FGColumnVector3 vWhlContactVec = vWhlBodyVec + vWhlDisplVec;
348  vActingXYZn = vXYZn + Tb2s * vWhlDisplVec;
349  FGColumnVector3 vBodyWhlVel = in.PQR * vWhlContactVec;
350  vBodyWhlVel += in.UVW - in.Tec2b * terrainVel;
351  vWhlVelVec = mTGear.Transposed() * vBodyWhlVel;
352 
353  InitializeReporting();
354  ComputeSteeringAngle();
355  ComputeGroundFrame();
356 
357  vGroundWhlVel = mT.Transposed() * vBodyWhlVel;
358 
359  if (fdmex->GetTrimStatus() || in.TotalDeltaT == 0.0)
360  compressSpeed = 0.0; // Steady state is sought during trimming
361  else {
362  compressSpeed = -vGroundWhlVel(eZ);
363  if (eContactType == ctBOGEY)
364  compressSpeed /= LGearProj;
365 
366  // If the gear is entering in contact with the ground during the current
367  // time step, the compression speed might actually be lower than the
368  // aircraft velocity projected along the gear leg (compressSpeed).
369  double maxCompressSpeed = compressLength/in.TotalDeltaT;
370  if (fabs(compressSpeed) > maxCompressSpeed)
371  compressSpeed = sign(compressSpeed)*maxCompressSpeed;
372  }
373 
374  ComputeVerticalStrutForce();
375 
376  // Compute the friction coefficients in the wheel ground plane.
377  if (eContactType == ctBOGEY) {
378  ComputeSlipAngle();
379  ComputeBrakeForceCoefficient();
380  ComputeSideForceCoefficient();
381  }
382 
383  // Prepare the Jacobians and the Lagrange multipliers for later friction
384  // forces calculations.
385  ComputeJacobian(vWhlContactVec);
386  } else { // Gear is NOT compressed
387  compressLength = 0.0;
388  compressSpeed = 0.0;
389  WheelSlip = 0.0;
390  StrutForce = 0.0;
391  vWhlDisplVec.InitMatrix();
392 
393  LMultiplier[ftRoll].value = 0.0;
394  LMultiplier[ftSide].value = 0.0;
395  LMultiplier[ftDynamic].value = 0.0;
396 
397  // Return to neutral position between 1.0 and 0.8 gear pos.
398  SteerAngle *= max(gearPos-0.8, 0.0)/0.2;
399 
400  ResetReporting();
401  }
402  }
403 
404  if (!WOW) {
405  // Let wheel spin down slowly
406  vWhlVelVec(eX) -= 13.0 * in.TotalDeltaT;
407  if (vWhlVelVec(eX) < 0.0) vWhlVelVec(eX) = 0.0;
408  }
409 
410  if (!fdmex->GetTrimStatus()) {
411  ReportTakeoffOrLanding();
412 
413  // Require both WOW and LastWOW to be true before checking crash conditions
414  // to allow the WOW flag to be used in terminating a scripted run.
415  if (WOW && lastWOW) CrashDetect();
416 
417  lastWOW = WOW;
418  }
419 
420  return FGForce::GetBodyForces();
421 }
+ 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 271 of file FGLGear.h.

271 { 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 268 of file FGLGear.h.

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

The documentation for this class was generated from the following files:
JSBSim::FGLocation::LocalToLocation
FGLocation LocalToLocation(const FGColumnVector3 &lvec) const
Conversion from Local frame coordinates to a location in the earth centered and fixed frame.
Definition: FGLocation.h:326
JSBSim::FGFDMExec::GetInertial
FGInertial * GetInertial(void)
Returns the FGInertial pointer.
Definition: FGFDMExec.h:367
JSBSim::FGSurface::FGSurface
FGSurface(FGFDMExec *fdmex, int number=-1)
Constructor.
Definition: FGSurface.cpp:52
JSBSim::FGFDMExec::GetGroundReactions
FGGroundReactions * GetGroundReactions(void)
Returns the FGGroundReactions pointer.
Definition: FGFDMExec.h:369
JSBSim::FGFDMExec::GetPropertyManager
FGPropertyManager * GetPropertyManager(void)
Returns a pointer to the property manager object.
Definition: FGFDMExec.cpp:1121
JSBSim::FGMatrix33::Transposed
FGMatrix33 Transposed(void) const
Transposed matrix.
Definition: FGMatrix33.h:221
JSBSim::FGForce::FGForce
FGForce(FGFDMExec *FDMExec)
Constructor.
Definition: FGForce.cpp:53
JSBSim::FGInertial::GetContactPoint
double GetContactPoint(const FGLocation &location, FGLocation &contact, FGColumnVector3 &normal, FGColumnVector3 &velocity, FGColumnVector3 &ang_velocity) const
Get terrain contact point information below the current location.
Definition: FGInertial.h:103