better handling of weird TPS values

This commit is contained in:
rusEfi 2019-05-04 10:54:26 -04:00
parent 40d5b047b2
commit 8c1c892907
1 changed files with 4 additions and 4 deletions

View File

@ -337,15 +337,15 @@ floatms_t getCrankingFuel3(float coolantTemperature,
uint32_t revolutionCounterSinceStart DECLARE_ENGINE_PARAMETER_SUFFIX) {
// these magic constants are in Celsius
float baseCrankingFuel = engineConfiguration->cranking.baseFuel;
if (cisnan(coolantTemperature)) // todo: move this check down, below duration correction?
return baseCrankingFuel;
float durationCoef = interpolate2d("crank", revolutionCounterSinceStart, config->crankingCycleBins,
config->crankingCycleCoef, CRANKING_CURVE_SIZE);
float coolantTempCoef = interpolate2d("crank", coolantTemperature, config->crankingFuelBins,
float coolantTempCoef = cisnan(coolantTemperature) ? 1 : interpolate2d("crank", coolantTemperature, config->crankingFuelBins,
config->crankingFuelCoef, CRANKING_CURVE_SIZE);
float tpsCoef = interpolate2d("crank", getTPS(PASS_ENGINE_PARAMETER_SIGNATURE), engineConfiguration->crankingTpsBins,
percent_t tps = getTPS(PASS_ENGINE_PARAMETER_SIGNATURE);
float tpsCoef = cisnan(tps) ? 1 : interpolate2d("crankTps", , engineConfiguration->crankingTpsBins,
engineConfiguration->crankingTpsCoef, CRANKING_CURVE_SIZE);
return baseCrankingFuel * durationCoef * coolantTempCoef * tpsCoef;