auto-sync
This commit is contained in:
parent
c01b2127c4
commit
d7fe7959a3
|
@ -313,8 +313,8 @@ static void showFuelInfo2(float rpm, float engineLoad) {
|
||||||
scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(&engine));
|
scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(&engine));
|
||||||
|
|
||||||
if (engine.rpmCalculator->isRunning()) {
|
if (engine.rpmCalculator->isRunning()) {
|
||||||
float iatCorrection = getIatCorrection(getIntakeAirTemperature(engineConfiguration2));
|
float iatCorrection = getIatCorrection(engineConfiguration, getIntakeAirTemperature(engineConfiguration2));
|
||||||
float cltCorrection = getCltCorrection(getCoolantTemperature(engineConfiguration2));
|
float cltCorrection = getCltCorrection(engineConfiguration, getCoolantTemperature(engineConfiguration2));
|
||||||
float injectorLag = getInjectorLag(engineConfiguration, getVBatt());
|
float injectorLag = getInjectorLag(engineConfiguration, getVBatt());
|
||||||
scheduleMsg(&logger2, "rpm=%f engineLoad=%f", rpm, engineLoad);
|
scheduleMsg(&logger2, "rpm=%f engineLoad=%f", rpm, engineLoad);
|
||||||
scheduleMsg(&logger2, "baseFuel=%f", baseFuel);
|
scheduleMsg(&logger2, "baseFuel=%f", baseFuel);
|
||||||
|
|
|
@ -72,13 +72,17 @@ static int getNumberOfInjections(engine_configuration_s const *engineConfigurati
|
||||||
* @returns Length of fuel injection, in milliseconds
|
* @returns Length of fuel injection, in milliseconds
|
||||||
*/
|
*/
|
||||||
float getFuelMs(int rpm, Engine *engine) {
|
float getFuelMs(int rpm, Engine *engine) {
|
||||||
|
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||||
|
float theoreticalInjectionLength;
|
||||||
if (isCranking()) {
|
if (isCranking()) {
|
||||||
return getCrankingFuel(engine) / getNumberOfInjections(engine->engineConfiguration, engine->engineConfiguration->crankingInjectionMode);
|
theoreticalInjectionLength = getCrankingFuel(engine) / getNumberOfInjections(engineConfiguration, engineConfiguration->crankingInjectionMode);
|
||||||
} else {
|
} else {
|
||||||
float baseFuel = getBaseFuel(engine, rpm);
|
float baseFuel = getBaseFuel(engine, rpm);
|
||||||
float fuelPerCycle = getRunningFuel(baseFuel, engine, rpm);
|
float fuelPerCycle = getRunningFuel(baseFuel, engine, rpm);
|
||||||
return fuelPerCycle / getNumberOfInjections(engine->engineConfiguration, engine->engineConfiguration->injectionMode);
|
theoreticalInjectionLength = fuelPerCycle / getNumberOfInjections(engineConfiguration, engine->engineConfiguration->injectionMode);
|
||||||
}
|
}
|
||||||
|
float injectorLag = getInjectorLag(engineConfiguration, getVBatt());
|
||||||
|
return theoreticalInjectionLength + injectorLag;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: start using 'engine' parameter and not 'extern'
|
// todo: start using 'engine' parameter and not 'extern'
|
||||||
|
@ -86,19 +90,15 @@ float getRunningFuel(float baseFuel, Engine *engine, int rpm) {
|
||||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||||
float iatCorrection = getIatCorrection(engineConfiguration, getIntakeAirTemperature(engine->engineConfiguration2));
|
float iatCorrection = getIatCorrection(engineConfiguration, getIntakeAirTemperature(engine->engineConfiguration2));
|
||||||
float cltCorrection = getCltCorrection(engineConfiguration, getCoolantTemperature(engine->engineConfiguration2));
|
float cltCorrection = getCltCorrection(engineConfiguration, getCoolantTemperature(engine->engineConfiguration2));
|
||||||
float injectorLag = getInjectorLag(engineConfiguration, getVBatt());
|
|
||||||
|
|
||||||
#if EFI_ACCEL_ENRICHMENT
|
#if EFI_ACCEL_ENRICHMENT
|
||||||
float accelEnrichment = getAccelEnrichment();
|
float accelEnrichment = getAccelEnrichment();
|
||||||
// todo: accelEnrichment
|
// todo: accelEnrichment
|
||||||
#endif /* EFI_ACCEL_ENRICHMENT */
|
#endif /* EFI_ACCEL_ENRICHMENT */
|
||||||
|
|
||||||
return baseFuel * cltCorrection * iatCorrection + injectorLag;
|
return baseFuel * cltCorrection * iatCorrection;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern Engine engine;
|
|
||||||
extern engine_configuration_s *engineConfiguration;
|
|
||||||
|
|
||||||
static Map3D1616 fuelMap;
|
static Map3D1616 fuelMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -116,7 +116,7 @@ static void updateErrorCodes(void) {
|
||||||
/**
|
/**
|
||||||
* technically we can set error codes right inside the getMethods, but I a bit on a fence about it
|
* technically we can set error codes right inside the getMethods, but I a bit on a fence about it
|
||||||
*/
|
*/
|
||||||
setError(isValidIntakeAirTemperature(getIntakeAirTemperature()), OBD_Intake_Air_Temperature_Circuit_Malfunction);
|
setError(isValidIntakeAirTemperature(getIntakeAirTemperature(engineConfiguration2)), OBD_Intake_Air_Temperature_Circuit_Malfunction);
|
||||||
setError(isValidCoolantTemperature(getCoolantTemperature(engineConfiguration2)), OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
|
setError(isValidCoolantTemperature(getCoolantTemperature(engineConfiguration2)), OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,13 @@ static char * prepareVBattMapLine(char *buffer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static char * prepareCltIatTpsLine(char *buffer) {
|
static char * prepareCltIatTpsLine(char *buffer) {
|
||||||
|
engine_configuration2_s *engineConfiguration2 = engine.engineConfiguration2;
|
||||||
char *ptr = buffer;
|
char *ptr = buffer;
|
||||||
*ptr++ = 'C';
|
*ptr++ = 'C';
|
||||||
ptr = ftoa(ptr, getCoolantTemperature(engine.engineConfiguration2), 10.0f);
|
ptr = ftoa(ptr, getCoolantTemperature(engineConfiguration2), 10.0f);
|
||||||
|
|
||||||
ptr = appendStr(ptr, " C");
|
ptr = appendStr(ptr, " C");
|
||||||
ptr = ftoa(ptr, getIntakeAirTemperature(), 10.0f);
|
ptr = ftoa(ptr, getIntakeAirTemperature(engineConfiguration2), 10.0f);
|
||||||
|
|
||||||
ptr = appendStr(ptr, " TP");
|
ptr = appendStr(ptr, " TP");
|
||||||
ptr = itoa10(ptr, (int) getTPS());
|
ptr = itoa10(ptr, (int) getTPS());
|
||||||
|
|
|
@ -293,7 +293,7 @@ static void printTemperatureInfo(void) {
|
||||||
scheduleMsg(&logger, "CLT sensing error");
|
scheduleMsg(&logger, "CLT sensing error");
|
||||||
}
|
}
|
||||||
printThermistor("IAT", &engineConfiguration2->iat);
|
printThermistor("IAT", &engineConfiguration2->iat);
|
||||||
if (!isValidIntakeAirTemperature(getIntakeAirTemperature())) {
|
if (!isValidIntakeAirTemperature(getIntakeAirTemperature(engineConfiguration2))) {
|
||||||
scheduleMsg(&logger, "IAT sensing error");
|
scheduleMsg(&logger, "IAT sensing error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ void testFuelMap(void) {
|
||||||
// because all the correction tables are zero
|
// because all the correction tables are zero
|
||||||
printf("*************************************************** getRunningFuel 1\r\n");
|
printf("*************************************************** getRunningFuel 1\r\n");
|
||||||
float baseFuel = getBaseTableFuel(eth.engine.engineConfiguration, 5, getEngineLoadT(ð.engine));
|
float baseFuel = getBaseTableFuel(eth.engine.engineConfiguration, 5, getEngineLoadT(ð.engine));
|
||||||
assertEqualsM("base fuel", 5.5, getRunningFuel(baseFuel, ð.engine, 5));
|
assertEqualsM("base fuel", 5.0, getRunningFuel(baseFuel, ð.engine, 5));
|
||||||
|
|
||||||
printf("*************************************************** setting IAT table\r\n");
|
printf("*************************************************** setting IAT table\r\n");
|
||||||
for (int i = 0; i < IAT_CURVE_SIZE; i++) {
|
for (int i = 0; i < IAT_CURVE_SIZE; i++) {
|
||||||
|
|
|
@ -81,7 +81,7 @@ void rusEfiFunctionalTest(void) {
|
||||||
|
|
||||||
resetConfigurationExt(NULL, FORD_ASPIRE_1996, engineConfiguration, engineConfiguration2);
|
resetConfigurationExt(NULL, FORD_ASPIRE_1996, engineConfiguration, engineConfiguration2);
|
||||||
|
|
||||||
initThermistors();
|
initThermistors(&engine);
|
||||||
initAlgo(engineConfiguration);
|
initAlgo(engineConfiguration);
|
||||||
initRpmCalculator();
|
initRpmCalculator();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue