IAS = Auxiliary->GetVcalibratedKTS();
- if (Mixture >= 0.3) {
doEngineStartup();
doManifoldPressure();
doAirFlow();
doFuelFlow();
- doEnginePower();
+
+ //Now that the fuel flow is done check if the mixture is too lean to run the engine
+ //Assume lean limit at 22 AFR for now - thats a thi of 0.668
+ //This might be a bit generous, but since there's currently no audiable warning of impending
+ //cutout in the form of misfiring and/or rough running its probably reasonable for now.
+ if(equivalence_ratio < 0.668)
+ Running = false;
+
+ doEnginePower();
doEGT();
doCHT();
doOilTemperature();
doOilPressure();
- } else {
- HP = 0;
- }
PowerAvailable = (HP * hptoftlbssec) - PowerRequired;
return PowerAvailable;
if ((!Running) && (spark) && (fuel)) {
// start the engine if revs high enough
- if ((RPM > 450) && (crank_counter > 175)) {
- // For now just instantaneously start but later we should maybe crank for
- // a bit
- Running = true;
- // RPM = 600;
+ if(Cranking) {
+ if ((RPM > 450) && (crank_counter > 175)) {
+ //Add a little delay to startup on the starter
+ Running = true;
+ }
+ } else {
+ if (RPM > 450) {
+ Running = true;
+ //This allows us to in-air start when windmilling
+ }
}
}
eParam tmpInputIndex;
clip = false;
+ Bias = 0.0;
InputIndices.clear();
InputTypes.clear();
tmpInputIndex = fcs->GetState()->GetParameterIndex(token);
InputIndices.push_back(tmpInputIndex);
InputTypes.push_back(itPilotAC);
+ } else if (token.find(".") != token.npos) { // bias
+ *AC_cfg >> Bias;
+ InputIndices.push_back((eParam)0);
+ InputTypes.push_back(itBias);
} else {
*AC_cfg >> tmpInputIndex;
InputIndices.push_back(tmpInputIndex);
case itFCS:
Output += fcs->GetComponentOutput(InputIndices[idx]);
break;
+ case itBias:
+ Output += Bias;
+ break;
}
}
HISTORY
--------------------------------------------------------------------------------
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SENTRY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "../FGConfigFile.h"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DEFINES
+DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#define ID_SUMMER "$Id$"
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Models a flight control system summing component.
+ The Summer component sums multiple inputs. These can be pilot control inputs,
+ state variables, or even floating point numbers (e.g. for a bias).
+ @author Jon S. Berndt
+ @version $Id$
+ @see
+*/
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS DECLARATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
class FGSummer : public FGFCSComponent
{
public:
+ /** Constructor.
+ @param fcs a pointer to the parent FGFCS object.
+ @param AC_cfg a pointer to the configuration file object. */
FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg);
+ /// Destructor
~FGSummer();
+ /// The execution method for this FCS component.
bool Run(void);
private:
vector <int> InputTypes;
bool clip;
double clipmin,clipmax;
+ double Bias;
void Debug(int from);
};