JSBSim GroundReactions

From FlightGear wiki
Jump to navigation Jump to search

JSBSim provides a framework for aerodynamics. This page will attempt to explain how to navigate the black art of JSBSim ground reactions, and how to create FDMs that are sane.

You will want to create ground reaction points for every part of the landing gear that may touch or interact with the ground, but also structural points for other parts of the aircraft that may touch or interact with the ground, for instance in a crash.

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. Name and type. BOGEY refers to contact points associated with the landing gear while STRUCTURE represents contact points associated with the airframe.
    • Both of these contact types basically result in a force which resists the penetration of the ground by the aircraft. The main difference between the two types of contacts is how the ground reaction force is computed--BOGEY types exert forces only in the vertical direction in the aircraft's frame of reference, whereas STRUCTURE types can exert force in any direction.
    • Furthermore the BOGEY type includes features which are typical to landing gears such as brake and steering.
  2. X, Y, Z location, in inches in structural coordinate frame
    • It may require experimentation to determine the X,Y,Z coordinates to use for contact points that will correspond to the same points on your visual model and look right. As weight or force is put on the contact points, they will compress and move--just as a spring compresses and contracts when forced is placed on it. Just for example, if bottom of the left landing gear is located at 20,40,-60 on your model, locating the JSBSim contact point at 20,40,-60 while most likely result in your landing gear appearing to be underground when the aircraft is on the runway. The reason is that if you have set the <spring_coeff> for the contact point to be, say, 200 LBS/FT and the landing gear has 400 LBS of force on it, it will be compressed by 2 FT--and thus in a spot 2 FT upwards from the point you specified. Generally you will need to specify your contact points some distance outwards from the aircraft body itself to compensate for this--a bit below the actual location of the landing gear, above the top of the fuselage, etc. The exact amount will depend on your <spring_coeff> and the characteristics of your aircraft, including its mass distribution and the location and characteristics of other contact points.
  3. Spring constant, in lbs/ft
  4. Damping coefficient, in lbs/ft/sec for linear damping or lbs/ft/sec^2 for square damping
  5. Dynamic Friction Coefficient
  6. Static Friction Coefficient

Operational Properties

  1. Name

BOGEY contact points also have the properties below available. These additional properties do not apply to STRUCTURE contact points and will be ignored if they are included in contact point definitions:

  1. Brake Group Membership {one of LEFT | CENTER | RIGHT | NOSE | TAIL | NONE}
  2. Max Steer Angle, in degrees. If negative, the steering will be in the opposite direction. 360 represents an un-steered caster.

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.
    • BOGEY forces act only in the z direction (vertical plane) whereas structure forces work in any/all directions (that is, the total force is calculated for both BOGEY and STRUCTURE, and then for BOGEY elements only the z component in the aircraft frame of reference is used). This is one reason it is important to surround BOGEY contact points with STRUCTURE contact points so that BOGEY contact points act only at angles near the vertical.
  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 | LBS/FT2/SEC2 | N/M2/SEC2}"> {number} </damping_coeff>
            <damping_coeff_rebound [type="SQUARE"] unit="{LBS/FT/SEC | N/M/SEC| LBS/FT2/SEC2 | N/M2/SEC2}"> {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>

Damping coefficients

The parameters <damping_coeff> and <damping_coeff_rebound> set the damping coefficient on compression and rebound, respectively. If <damping_coeff_rebound> is omitted, the rebound coefficient defaults to the same as the <damping_coeff>.

The <damping_coeff> and <damping_coeff_rebound> parameters can be set to use either linear or square damping. The default is linear (damping proportional to the velocity of the compression or rebound). Use 'type="SQUARE"' to specify square damping (damping proportional to the square of velocity of the compression or rebound).

If linear, units are LBS/FT/SEC or N/M/SEC. If square, units are LBS/FT2/SEC2 or N/M2/SEC2.

Using square damping should result in more vigorous damping under extreme forces and accelerations and its use, especially for <damping_coeff_rebound>, may help reduce extreme ground reaction forces sometimes experienced under JSBSim.

Retractable landing gear

Setting retractable to 1 simply alerts JSBSim that this gear is retractable. If the gear is retracted in Flightgear, JSBSim will simply ignore this contact point entirely.

JSBSim considers a gear that is even partially retracted (99% extended or less) to be retracted and ignores it.

Hints

  • FlightGear runs JSBSim at 120 Hertz. That's fine for the overall FDM, but incredibly slow for a high fidelity gear model. The problem is worse for a higher spring rate gear, use the softest spring rate you can live with.
  • Spring rate (spring_coeff) is the weight on the gear divided by the gear deflection. You can specify Pounds per foot or Newtons per Meter. Look at photos of the aircraft you are modeling before and after it lands to get an idea about how far the gears compress. Multiplying gear/compression-ft by the spring rate will tell you how much weight is on the gear so you can tune it.
  • Contacts of type BOGEY get out of control if they intersect the ground at a steep angles. Use STRUCTURE contacts around the BOGEY to limit the ground contact angle.
  • Aeromatic uses 20% of the spring rate for a damping rate on the main gear and tail gear and 30% of the nose spring rate.

Additional Parameter: Relaxation Velocity

Any contact point can have a relaxation_velocity element. Example of the relaxation velocity parameter input:

    <relaxation_velocity>
      <rolling unit="FT/SEC"> 0 </rolling>
      <side unit="FT/SEC"> 0 </side>
    </relaxation_velocity>

According to Jon Berndt (here), "This turns off the fade-in/out for forces at near-zero or zero velocity." Normally this would not be set to 0, as it is in this example.

Additional function: Strut Force

JSBSim now allows inclusion of an arbitrary table or function to calculate strut force, rather than using JSBSim's built-in functions to calculate forces and damping on a contact point. This should be operational in Flightgear 2.8 and forward. Include a section like this within your contact definition:

             <strut_force>
                <function>
                    <sum>
                        <product>
                            <value> -5400. </value>
                            <property> gear/unit[2]/compression-ft </property>
                        </product>
                        <ifthen>
                            <ge>
                                <property> gear/unit[2]/compression-velocity-fps </property>
                                <value> 0.0 </value>
                            </ge>
                            <product>
                                <value> -160. </value>
                                <property> gear/unit[2]/compression-velocity-fps </property>
                            </product>
                            <product>
                                <value> -320. </value>
                                <property> gear/unit[2]/compression-velocity-fps </property>
                            </product>
                        </ifthen>
                    </sum>
                </function>
            </strut_force>

The strut_force section above would replace and replicate the function of this section of a contact definition:

            <spring_coeff unit="LBS/FT">5400</spring_coeff>		
            <damping_coeff unit="LBS/FT/SEC">160</damping_coeff>		
            <damping_coeff_rebound unit="LBS/FT/SEC">320</damping_coeff_rebound>

More information and example usage here.

JSBSim example usage here.

How ground reaction forces are calculated

The ground reactions are computed as forces that support the aircraft above the ground, and affect the motion over the ground. These forces can thus be split into two components:

  1. the ground normal reaction, ie, support of the aircraft above the ground
  2. the ground tangential reaction, ie, friction of the aircraft along the ground

JSBSim computes the ground normal reaction by a spring/damper model. The normal reaction force is therefore obtained by the formula

  Fn = k*u + b*v (linear damping) 

Or

  Fn = k*u + b*v^2 (square damping)

where k is the spring stiffness, b is the spring damping, u is the displacement due to compression, and v is the rate of compression. Spring damping, b, is

Parameters u and v are computed by JSBSim and k and b are given respectively by the <spring_coeff>, <damping_coeff> and <damping_coeff_rebound> properties in the <contact> element definition. If v is positive then <damping_coeff> is used; if v is negative then <damping_coeff_rebound> is used.

If the strut_force element is included, then your calculation of the strut force is substituted in placed of this formula, and parameters <spring_coeff>, <damping_coeff> and <damping_coeff_rebound> are ignored.

Note that there is no upper limit to amount of compression of a contact element allowed--and thus the amount of force generated under, for example, extreme ground collisions. This is one reason for the extremely elastic ground collisions sometimes observed when JSBSim aircraft strike the ground at high speed.

(See the actual code that implements this under function ComputeVerticalStrutForce here

Related content

Forum topics

External links