Skip to content

Commit

Permalink
The compression speed must be capped when entering into contact.
Browse files Browse the repository at this point in the history
When a gear is entering into contact with the ground, only a fraction of its travel might result in actual compression of the gear leg. This is now accounted for in the computation of the compression speed.
  • Loading branch information
bcoconni committed Mar 10, 2019
1 parent d3845eb commit 574f855
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/models/FGLGear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ DEFINITIONS
GLOBAL DATA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

// Body To Structural (body frame is rotated 180 deg about Y and lengths are given in
// ft instead of inches)
// Body To Structural (body frame is rotated 180 deg about Y and lengths are
// given in ft instead of inches)
const FGMatrix33 FGLGear::Tb2s(-1./inchtoft, 0., 0., 0., 1./inchtoft, 0., 0., 0., -1./inchtoft);
const FGMatrix33 FGLGear::Ts2b(-inchtoft, 0., 0., 0., inchtoft, 0., 0., 0., -inchtoft);

Expand Down Expand Up @@ -308,9 +308,9 @@ const FGColumnVector3& FGLGear::GetBodyForces(FGSurface *surface)
vGroundNormal = in.Tec2b * normal;

// The height returned by GetGroundCallback() is the AGL and is expressed
// in the Z direction of the local coordinate frame. We now need to transform
// this height in actual compression of the strut (BOGEY) or in the normal
// direction to the ground (STRUCTURE)
// in the Z direction of the local coordinate frame. We now need to
// transform this height in actual compression of the strut (BOGEY) or in
// the normal direction to the ground (STRUCTURE)
double normalZ = (in.Tec2l*normal)(eZ);
LGearProj = -(mTGear.Transposed() * vGroundNormal)(eZ);

Expand Down Expand Up @@ -348,12 +348,19 @@ const FGColumnVector3& FGLGear::GetBodyForces(FGSurface *surface)

vGroundWhlVel = mT.Transposed() * vBodyWhlVel;

if (fdmex->GetTrimStatus())
if (fdmex->GetTrimStatus() || in.TotalDeltaT == 0.0)
compressSpeed = 0.0; // Steady state is sought during trimming
else {
compressSpeed = -vGroundWhlVel(eZ);
if (eContactType == ctBOGEY)
compressSpeed /= LGearProj;

// If the gear is entering in contact with the ground during the current
// time step, the compression speed might actually be lower than the
// aircraft velocity projected along the gear leg (compressSpeed).
double maxCompressSpeed = compressLength/in.TotalDeltaT;
if (fabs(compressSpeed) > maxCompressSpeed)
compressSpeed = sign(compressSpeed)*maxCompressSpeed;
}

ComputeVerticalStrutForce();
Expand Down

0 comments on commit 574f855

Please sign in to comment.