X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2FFGLGear.h;h=0b2536a187e002f21c3492eb1499e4a784ee005a;hb=407dcaff6236e7217eff16ac253218d3e51bce6d;hp=be4abad6ff2b9f4a6ebbb9ef249dfaf13d6cfec0;hpb=7715f7d8723c1e66c2185e631e1af1aa80c2707e;p=flightgear.git diff --git a/src/FDM/JSBSim/FGLGear.h b/src/FDM/JSBSim/FGLGear.h index be4abad6f..0b2536a18 100644 --- a/src/FDM/JSBSim/FGLGear.h +++ b/src/FDM/JSBSim/FGLGear.h @@ -1,4 +1,4 @@ -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGLGear.h Author: Jon S. Berndt @@ -27,32 +27,16 @@ HISTORY -------------------------------------------------------------------------------- 11/18/99 JSB Created -******************************************************************************** +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SENTRY -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifndef FGLGEAR_H #define FGLGEAR_H -/******************************************************************************* -COMMENTS, REFERENCES, and NOTES -******************************************************************************** - -[1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling - Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate - School, January 1994 -[2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices", - JSC 12960, July 1977 -[3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at - NASA-Ames", NASA CR-2497, January 1975 -[4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics", - Wiley & Sons, 1979 ISBN 0-471-03032-5 -[5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons, - 1982 ISBN 0-471-08936-2 - -******************************************************************************** +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INCLUDES -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #ifdef FGFS # include @@ -64,47 +48,177 @@ INCLUDES #include "FGFDMExec.h" #include "FGState.h" -/******************************************************************************* +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINITIONS -*******************************************************************************/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #define ID_LGEAR "$Header" -/******************************************************************************* -CLASS DECLARATION -*******************************************************************************/ +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +FORWARD DECLARATIONS +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ class FGAircraft; class FGPosition; class FGRotation; +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DOCUMENTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + +/** 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. +
  3. Spring constant, in lbs/ft
  4. +
  5. Damping coefficient, in lbs/ft/sec
  6. +
  7. Dynamic Friction Coefficient
  8. +
  9. Static Friction Coefficient
  10. +

+ Operational Properties
+

    +
  1. Name
  2. +
  3. Steerability attribute {one of STEERABLE | FIXED | CASTERED}
  4. +
  5. Brake Group Membership {one of LEFT | CENTER | RIGHT | NOSE | TAIL | NONE}
  6. +
  7. Max Steer Angle, in degrees
  8. +

+

+ 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. +
  3. 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.
  4. +
  5. The new gear location is now transformed to the local coordinate frame + using the body-to-local matrix. (Mb2l).
  6. +
  7. 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.
  8. +
  9. If the gear is compressed, a Weight-On-Wheels (WOW) flag is set.
  10. +
  11. 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.
  12. +
  13. 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.
  14. +
  15. The compression speed is the Z-component of the vector.
  16. +
  17. 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.
  18. +
  19. Since the friction force takes place solely in the runway plane, the Z + coordinate of the normalized wheel velocity vector is set to zero.
  20. +
  21. 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.
  22. +
  23. 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. +
  24. +
  25. The wheel force in local frame is next converted to body frame.
  26. +
  27. 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.
  28. +
+ @author Jon S. Berndt + @version $Id$ + @see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at + NASA-Ames", NASA CR-2497, January 1975 + @see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics", + Wiley & Sons, 1979 ISBN 0-471-03032-5 +*/ + +/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CLASS DECLARATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + class FGLGear { public: - FGLGear(FGConfigFile*, FGFDMExec*); + /// Brake grouping enumerators + enum eBrakeGroup {bgNone=0, bgLeft, bgRight, bgCenter, bgNose, bgTail }; + /** Constructor + @param Executive a pointer to the parent executive object + @param File a pointer to the config file instance */ + FGLGear(FGConfigFile* File, FGFDMExec* Executive); + /** Constructor + @param lgear a reference to an existing FGLGear object */ + FGLGear(const FGLGear& lgear); + /// Destructor ~FGLGear(void); + + /// The Force vector for this gear FGColumnVector Force(void); + /// The Moment vector for this gear FGColumnVector Moment(void) {return vMoment;} + /// Gets the location of the gear in Body axes FGColumnVector GetBodyLocation(void) { return vWhlBodyVec; } + + FGColumnVector GetLocalGear(void) { return vLocalGear; } + /// Gets the name of the gear inline string GetName(void) {return name; } + /// Gets the Weight On Wheels flag value inline bool GetWOW(void) {return WOW; } + /// Gets the current compressed length of the gear in feet inline float GetCompLen(void) {return compressLength;} + /// Gets the current gear compression velocity in ft/sec inline float GetCompVel(void) {return compressSpeed; } + /// Gets the gear compression force in pounds inline float GetCompForce(void) {return Force()(3); } + /// Sets the brake value in percent (0 - 100) inline void SetBrake(double bp) {brakePct = bp;} - - inline void SetReport(bool bb) { ReportEnable=bb; } + + /** Set the console touchdown reporting feature + @param flag true turns on touchdown reporting, false turns it off */ + inline void SetReport(bool flag) { ReportEnable = flag; } + /** Get the console touchdown reporting feature + @return true if reporting is turned on */ inline bool GetReport(void) { return ReportEnable; } - private: enum {eX=1, eY, eZ}; FGColumnVector vXYZ; FGColumnVector vMoment; FGColumnVector vWhlBodyVec; + FGColumnVector vLocalGear; float kSpring; float bDamp; float compressLength; @@ -122,9 +236,9 @@ private: bool Reported; bool ReportEnable; string name; - string BrakeType; string SteerType; - string GroupMember; + string BrakeGroup; + eBrakeGroup eBrakeGrp; float maxSteerAngle; FGFDMExec* Exec; @@ -140,5 +254,5 @@ private: #include "FGPosition.h" #include "FGRotation.h" -/******************************************************************************/ +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #endif