#include <ccalculatorefi.h>


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 CBinaryOutputGPIO * | mInjectors [] |
| static CMachine::real | mInjectorTurnOnDelay = 1.5 |
| static CMachine::real | mInjectorVoltageLevel = 13.4 |
Definition at line 32 of file ccalculatorefi.h.
Define the injector strategy enumerators...
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;
| 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] |
| 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.
| 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.
| 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.
| 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().

| 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.
Reimplemented from PikeAero::ITask.
Definition at line 61 of file ccalculatorefi.cpp.
| 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.
Reimplemented from PikeAero::ITask.
Definition at line 112 of file ccalculatorefi.cpp.
| 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().

| 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 }

| 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.
| 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 }

| CMachine::bit32 PikeAero::CCalculatorEFI::run | ( | ) | [virtual] |
called periodically by CTaskScheduler to do a piece of work.
Reimplemented from PikeAero::ITask.
Definition at line 84 of file ccalculatorefi.cpp.
| CMachine::bit32 PikeAero::CCalculatorEFI::start | ( | ) | [virtual] |
called exactly once. all tasks are initialized at this point. called just prior to first call to run()
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.
Reimplemented from PikeAero::ITask.
Definition at line 93 of file ccalculatorefi.cpp.
CMachine::real PikeAero::CCalculatorEFI::mInjectorFlowRate = 25.2 [static, private] |
Voltage level for the injectors.
Definition at line 97 of file ccalculatorefi.h.
Referenced by injectorFlowRate().
CBinaryOutputGPIO * PikeAero::CCalculatorEFI::mInjectors [static, private] |
startEnrichment + afterStartEnrichment + warmupEnrichment + accelerationEnrichment
Definition at line 94 of file ccalculatorefi.h.
CMachine::real PikeAero::CCalculatorEFI::mInjectorTurnOnDelay = 1.5 [static, private] |
List of fuel injectors
Definition at line 95 of file ccalculatorefi.h.
Referenced by injectorTurnOnDelay().
CMachine::real PikeAero::CCalculatorEFI::mInjectorVoltageLevel = 13.4 [static, private] |
Time (in microseconds) required for the injector to turn on at the current voltage level
Definition at line 96 of file ccalculatorefi.h.
1.5.8