PikeAero::CCalculatorEFI Class Reference

#include <ccalculatorefi.h>

Inheritance diagram for PikeAero::CCalculatorEFI:

Inheritance graph
[legend]
Collaboration diagram for PikeAero::CCalculatorEFI:

Collaboration graph
[legend]

Public Types


Public Member Functions

 CCalculatorEFI ()
virtual CMachine::bit32 fault ()
virtual CMachine::bit32 init ()
virtual bool iowait ()
virtual const char * name ()
virtual CMachine::bit32 run ()
virtual CMachine::bit32 start ()
virtual CMachine::bit32 stop ()
virtual ~CCalculatorEFI ()

Static Protected Member Functions

static CMachine::real airDensity ()
static CMachine::real barometricPressure ()
static CMachine::real batteryCompensation ()
static CMachine::real gammaEnrichment ()
static CMachine::real injectorFlowRate ()
static CMachine::real injectorTurnOnDelay ()
static CMachine::real manualEnrichment ()
static CMachine::real massAirFlow ()
static CMachine::bit32 pulesWidth ()
static CMachine::real requiredFuel ()

Static Private Attributes

static CMachine::real mInjectorFlowRate = 25.2
static CBinaryOutputGPIOmInjectors []
static CMachine::real mInjectorTurnOnDelay = 1.5
static CMachine::real mInjectorVoltageLevel = 13.4

Detailed Description

Implements the EFI calculator.
Author:
Michael Sharkey <mike@pikeaero.com>

Definition at line 32 of file ccalculatorefi.h.


Member Enumeration Documentation

Define the injector strategy enumerators...

Enumerator:
Batch 
BankToBank  Batch mode.
Sequencial  Bank to Bank mode.

Definition at line 41 of file ccalculatorefi.h.

00041                      {
00042             Batch=1,            /** Batch mode. */
00043             BankToBank=2,       /** Bank to Bank mode. */
00044             Sequencial=3        /** Sequencial mode */
00045         } Strategy;


Constructor & Destructor Documentation

PikeAero::CCalculatorEFI::CCalculatorEFI (  ) 

Injector flow rate lbs per hour

Definition at line 39 of file ccalculatorefi.cpp.

00040  : ITask()
00041 {
00042 }

PikeAero::CCalculatorEFI::~CCalculatorEFI (  )  [virtual]

Definition at line 45 of file ccalculatorefi.cpp.

00046 {
00047 }


Member Function Documentation

CMachine::real PikeAero::CCalculatorEFI::airDensity (  )  [static, protected]

Mass air (pounds per cylinder firing) for desired fuel/air ratio, also equal to the mass fuel required.

air density (in pounds per cubic feet) 31 = 3.1 Kpa correction for vapor pressure, assuming a humidity of 75 percent at 85 degrees F temperature.

Definition at line 171 of file ccalculatorefi.cpp.

00172 {
00173     //(0.0391568 * (barometricPressure() - 31.0)) / ((manifoldAirTemperature()/10)+459.7);
00174     return 0.0;
00175 }

CMachine::real PikeAero::CCalculatorEFI::barometricPressure (  )  [static, protected]

air density (in pounds per cubic feet)

barometric pressure in KPa * 10 (from sensor),

FIXME - read the sensor value

Definition at line 180 of file ccalculatorefi.cpp.

00181 {
00182     /** FIXME - read the sensor value */
00183     return 330.0;
00184 }

CMachine::real PikeAero::CCalculatorEFI::batteryCompensation (  )  [static, protected]

Time in microseconds for injector to open fully when normal voltage is applied

Compensation in microseconds for variation in battery voltage

FIXME - do the real thing here

Definition at line 135 of file ccalculatorefi.cpp.

00136 {
00137     /** FIXME - do the real thing here */
00138     return 0.0;
00139 }

CMachine::bit32 PikeAero::CCalculatorEFI::fault (  )  [virtual]

The CTaskScheduler will call the fault() method when a fault code was returned by any of the task's other methods.

Reimplemented from PikeAero::ITask.

Definition at line 102 of file ccalculatorefi.cpp.

00103 {
00104     return 0;
00105 }

CMachine::real PikeAero::CCalculatorEFI::gammaEnrichment (  )  [static, protected]

Manual setting: Each increment represents a 1 percent increase/decrease in the fuel/air ratio.

startEnrichment + afterStartEnrichment + warmupEnrichment + accelerationEnrichment

FIXME - do the real thing here.

Definition at line 198 of file ccalculatorefi.cpp.

Referenced by requiredFuel().

00199 {
00200     /** FIXME - do the real thing here. */
00201     return 100.0;
00202 }

Here is the caller graph for this function:

CMachine::bit32 PikeAero::CCalculatorEFI::init (  )  [virtual]

called exactly once. perform task initialization such as initializing private variable. other tasks are not guaranteed so do not interract with other tasks at this stage.

Returns:
0 on success.
called exactly once. perform task initialization such as initializing private variable. other tasks are not guaranteed so do not interract with other tasks at this stage.
Returns:
0 on success.

Reimplemented from PikeAero::ITask.

Definition at line 61 of file ccalculatorefi.cpp.

00062 {
00063     return 0;
00064 }

CMachine::real PikeAero::CCalculatorEFI::injectorFlowRate (  )  [static, protected]

Total fuel required in pounds for a particular cylinder firing.

Injector flow rate in lbs per microsecond.

Definition at line 152 of file ccalculatorefi.cpp.

References mInjectorFlowRate.

00153 {
00154     return ((mInjectorFlowRate/60.0)/60.0)/1000000.0;
00155 }

CMachine::real PikeAero::CCalculatorEFI::injectorTurnOnDelay (  )  [static, protected]

Calculate the target pulse width in microseconds.

Time in microseconds for injector to open fully when normal voltage is applied

Definition at line 127 of file ccalculatorefi.cpp.

References mInjectorTurnOnDelay.

00128 {
00129     return mInjectorTurnOnDelay;
00130 }

bool PikeAero::CCalculatorEFI::iowait (  )  [virtual]

The CTaskScheduler::iowait() method will call the task's iowait method periodically to test if the task is still in an I/O wait state.

Returns:
true if still waiting on I/O, false otherwise.

Reimplemented from PikeAero::ITask.

Definition at line 112 of file ccalculatorefi.cpp.

00113 {
00114     return false;
00115 }

CMachine::real PikeAero::CCalculatorEFI::manualEnrichment (  )  [static, protected]

barometric pressure in KPa * 10 (from sensor), 31 = 3.1 Kpa correction for vapor pressure, assuming a humidity of 75 percent at 85 degrees F temperature.

Manual setting: Each increment represents a 1 percent increase/decrease in the fuel/air ratio.

FIXME - read this value from somewhere.

Definition at line 189 of file ccalculatorefi.cpp.

Referenced by requiredFuel().

00190 {
00191     /** FIXME - read this value from somewhere. */
00192     return 0.0;
00193 }

Here is the caller graph for this function:

CMachine::real PikeAero::CCalculatorEFI::massAirFlow (  )  [static, protected]

Injector flow rate in lbs per microsecond.

Mass air (pounds per cylinder firing) for desired fuel/air ratio, also equal to the mass fuel required.

(CID/1728) term which is the cubic inch displacement of the engine, converted into cubic feet

the (1/NCYL) which is the number of cylinders, the (1/14.7), which is the factor which normalizes air/fuel to stoichiometric

Definition at line 160 of file ccalculatorefi.cpp.

Referenced by requiredFuel().

00161 {
00162     /** (CID/1728) term which is the cubic inch displacement of the engine, converted into cubic feet */
00163     /** the (1/NCYL) which is the number of cylinders, the (1/14.7), which is the factor which normalizes air/fuel to stoichiometric */
00164 //  return airDensity() * (cubicInchDisplacement()/1728.0) * (1/(14.7*numberOfCylinders())) * (manifoldPressure()/manifoldPressureWOT()) * (volumetricEfficiency(manifoldPressure(),rpm())/airFuelRatio(manifoldPeressure(),rpm())/14.7);
00165     return 0.0;
00166 }

Here is the caller graph for this function:

const char * PikeAero::CCalculatorEFI::name (  )  [virtual]

returns a CString containing an human readable name for the task

Reimplemented from PikeAero::ITask.

Definition at line 51 of file ccalculatorefi.cpp.

00052 {
00053     return "CCalculatorEFI";
00054 }

CMachine::bit32 PikeAero::CCalculatorEFI::pulesWidth (  )  [static, protected]

Definition at line 118 of file ccalculatorefi.cpp.

00119 {
00120     CMachine::bit32 n = 0; /* TURN_ON_FLOW_FACTOR * ( injectorTurnOnDelay() + batteryCompensation() ) + ( requiredFuel() / injectorFlowRate() ); */
00121     return n;
00122 }

CMachine::real PikeAero::CCalculatorEFI::requiredFuel (  )  [static, protected]

Compensation in microseconds for variation in battery voltage

Total fuel required in pounds for a particular cylinder firing.

Definition at line 144 of file ccalculatorefi.cpp.

References gammaEnrichment(), manualEnrichment(), and massAirFlow().

00145 {
00146     return massAirFlow() * (gammaEnrichment()/100.0) * (1+(manualEnrichment()/100.0));
00147 }

Here is the call graph for this function:

CMachine::bit32 PikeAero::CCalculatorEFI::run (  )  [virtual]

called periodically by CTaskScheduler to do a piece of work.

Returns:
0 on success.

Reimplemented from PikeAero::ITask.

Definition at line 84 of file ccalculatorefi.cpp.

00085 {
00086     return 0;
00087 }

CMachine::bit32 PikeAero::CCalculatorEFI::start (  )  [virtual]

called exactly once. all tasks are initialized at this point. called just prior to first call to run()

Returns:
0 on success.
called exactly once. all tasks are initialized at this point. called just prior to first call to run()
Returns:
0 on success.

FIXME - get initial injector configuration data

Reimplemented from PikeAero::ITask.

Definition at line 70 of file ccalculatorefi.cpp.

References MAX_INJECTORS.

00071 {
00072     /** FIXME - get initial injector configuration data */
00073     for( int n=0; n<MAX_INJECTORS; n++ )
00074     {
00075         // FIXME mInjectors[n] = new CBinaryOutputGPIO();
00076     }
00077     return 0;
00078 }

CMachine::bit32 PikeAero::CCalculatorEFI::stop (  )  [virtual]

The CTaskScheduler will call the stop () method after the task was scheduled for cancelation.

Returns:
0 on success.

Reimplemented from PikeAero::ITask.

Definition at line 93 of file ccalculatorefi.cpp.

00094 {
00095     return 0;
00096 }


Field Documentation

Voltage level for the injectors.

Definition at line 97 of file ccalculatorefi.h.

Referenced by injectorFlowRate().

startEnrichment + afterStartEnrichment + warmupEnrichment + accelerationEnrichment

Definition at line 94 of file ccalculatorefi.h.

List of fuel injectors

Definition at line 95 of file ccalculatorefi.h.

Referenced by injectorTurnOnDelay().

Time (in microseconds) required for the injector to turn on at the current voltage level

Definition at line 96 of file ccalculatorefi.h.


The documentation for this class was generated from the following files:

Generated on Sun Oct 25 13:59:47 2009 for stingray3 by  doxygen 1.5.8