void testSpeedDensity(void) { printf("*************************************************** testSpeedDensity\r\n"); EngineTestHelper eth(FORD_INLINE_6_1995); EXPAND_EngineTestHelper; schedulingQueue.clear(); // todo: there must be a better place for this eth.ec->trigger.customTotalToothCount = 8; eth.applyTriggerShape(); eth.fireTriggerEvents(36); assertEqualsM("RPM", 1500, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_F)); // 427 cubic inches, that's a LOT of engine eth.ec->specs.displacement = 6.99728; eth.ec->specs.cylindersCount = 8; eth.ec->injector.flow = gramm_second_to_cc_minute(5.303); float airMass = getAirMass(eth.ec, 0.92, 98, 293.16); assertEquals(0.9371, airMass); // 0.01414 sec or 14.14 ms assertEquals(0.01414, sdMath(eth.ec, airMass, 12.5)); }
static void showFuelInfo2(float rpm, float engineLoad) { float baseFuelMs = getBaseTableFuel(engineConfiguration, (int) rpm, engineLoad); float magicAir = getAirMass(engineConfiguration, 1, 100, convertCelsiusToKelvin(20)); scheduleMsg(&logger, "SD magic fuel %f", sdMath(engineConfiguration, magicAir, 14.7)); scheduleMsg(&logger, "inj flow %fcc/min displacement %fL", engineConfiguration->injector.flow, engineConfiguration->specs.displacement); scheduleMsg(&logger2, "algo=%s/pump=%s", getEngine_load_mode_e(engineConfiguration->fuelAlgorithm), boolToString(enginePins.fuelPumpRelay.getLogicValue())); scheduleMsg(&logger2, "injection phase=%f/global fuel correction=%f", getinjectionOffset(rpm), engineConfiguration->globalFuelCorrection); scheduleMsg(&logger2, "baro correction=%f", engine->engineState.baroCorrection); #if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) scheduleMsg(&logger, "base cranking fuel %f", engineConfiguration->cranking.baseFuel); scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(PASS_ENGINE_PARAMETER_F)); if (engine->rpmCalculator.isRunning(PASS_ENGINE_PARAMETER_F)) { float iatCorrection = engine->engineState.iatFuelCorrection; float cltCorrection = engine->engineState.cltFuelCorrection; floatms_t injectorLag = engine->engineState.injectorLag; scheduleMsg(&logger2, "rpm=%f engineLoad=%f", rpm, engineLoad); scheduleMsg(&logger2, "baseFuel=%f", baseFuelMs); scheduleMsg(&logger2, "iatCorrection=%f cltCorrection=%f injectorLag=%f", iatCorrection, cltCorrection, injectorLag); float value = getRunningFuel(baseFuelMs, (int) rpm PASS_ENGINE_PARAMETER); scheduleMsg(&logger2, "injection pulse width: %f", value); } #endif }