#include "FGPropeller.h"
#include "FGFCS.h"
+namespace JSBSim {
+
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_PROPELLER;
int rows, cols;
MaxPitch = MinPitch = P_Factor = Sense = Pitch = 0.0;
+ GearRatio = 1.0;
Name = Prop_cfg->GetValue("NAME");
Prop_cfg->GetNextConfigLine();
Diameter /= 12.0;
} else if (token == "NUMBLADES") {
*Prop_cfg >> numBlades;
+ } else if (token == "GEARRATIO") {
+ *Prop_cfg >> GearRatio;
} else if (token == "MINPITCH") {
*Prop_cfg >> MinPitch;
} else if (token == "MAXPITCH") {
if (omega <= 5) omega = 1.0;
- ExcessTorque = PowerAvailable / omega;
+ ExcessTorque = PowerAvailable / omega * GearRatio;
RPM = (RPS + ((ExcessTorque / Ixx) / (2.0 * M_PI)) * deltaT) * 60.0;
+ // The friction from the engine should
+ // stop it somewhere; I chose an
+ // arbitrary point.
+ if (RPM < 5.0)
+ RPM = 0;
+
vMn = fdmex->GetRotation()->GetPQR()*vH + vTorque*Sense;
return Thrust; // return thrust in pounds
else if (Pitch > MaxPitch) Pitch = MaxPitch;
} else {
- Pitch = MaxPitch - (MaxPitch - MinPitch) * advance;
+ Pitch = MinPitch + (MaxPitch - MinPitch) * advance;
}
cPReq = cPower->GetValue(J, Pitch);
}
}
}
}
-
+}