JSBSim Flight Dynamics Model  1.2.0 (05 Nov 2023)
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 191 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 , tInertialBody ,
  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.
 
const FGColumnVector3GetBodyForces (void) override
 The Force vector for this gear.
 
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 (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
 
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 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 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 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
 
- Static Protected Member Functions inherited from FGJSBBase
static std::string CreateIndexedPropertyName (const std::string &Property, int index)
 
- Protected Attributes inherited from FGForce
FGFDMExecfdmex
 
std::shared_ptr< FGMassBalanceMassBalance
 
FGMatrix33 mT
 
TransformType ttype
 
FGColumnVector3 vActingXYZn
 
FGColumnVector3 vFn
 
FGColumnVector3 vMn
 
FGColumnVector3 vOrient
 
FGColumnVector3 vXYZn
 
- Static Protected Attributes inherited from FGJSBBase
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 fttom = 0.3048
 
static constexpr double ktstofps = 1852./(3600*fttom)
 
static constexpr double fpstokts = 1.0 / ktstofps
 
static constexpr double inchtoft = 1.0/12.0
 
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__
 

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

72  :
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  auto 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().get();
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  bind(PropertyManager.get());
234 
235  Debug(0);
236 }
std::shared_ptr< FGGroundReactions > GetGroundReactions(void) const
Returns the FGGroundReactions pointer.
Definition: FGFDMExec.cpp:348
std::shared_ptr< FGPropertyManager > GetPropertyManager(void) const
Returns a pointer to the property manager object.
Definition: FGFDMExec.h:421
FGForce(FGFDMExec *FDMExec)
Constructor.
Definition: FGForce.cpp:52
+ Here is the call graph for this function:

Member Function Documentation

◆ GetReport()

bool GetReport ( void  ) const
inline

Get the console touchdown reporting feature.

Returns
true if reporting is turned on

Definition at line 270 of file FGLGear.h.

270 { 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 267 of file FGLGear.h.

267 { ReportEnable = flag; }

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