flex cranking math (#3791)
* flex cranking math * simplify * s * simplify
This commit is contained in:
parent
751355a04b
commit
c2eab94534
|
@ -61,21 +61,23 @@ float getCrankingFuel3(
|
|||
* Cranking fuel is different depending on engine coolant temperature
|
||||
* If the sensor is failed, use 20 deg C
|
||||
*/
|
||||
auto clt = Sensor::get(SensorType::Clt);
|
||||
engine->engineState.cranking.coolantTemperatureCoefficient =
|
||||
interpolate2d(clt.value_or(20), config->crankingFuelBins, config->crankingFuelCoef);
|
||||
auto clt = Sensor::get(SensorType::Clt).value_or(20);
|
||||
auto e0Mult = interpolate2d(clt, config->crankingFuelBins, config->crankingFuelCoef);
|
||||
|
||||
if (Sensor::hasSensor(SensorType::FuelEthanolPercent)) {
|
||||
auto e100 = interpolate2d(clt, config->crankingFuelBins, config->crankingFuelCoefE100);
|
||||
|
||||
auto flex = Sensor::get(SensorType::FuelEthanolPercent);
|
||||
engine->engineState.cranking.coolantTemperatureCoefficient = priv::linterp(e0Mult, e100, flex.value_or(50));
|
||||
} else {
|
||||
engine->engineState.cranking.coolantTemperatureCoefficient = e0Mult;
|
||||
}
|
||||
|
||||
auto tps = Sensor::get(SensorType::DriverThrottleIntent);
|
||||
|
||||
engine->engineState.cranking.tpsCoefficient = tps.Valid ? 1 : interpolate2d(tps.Value, engineConfiguration->crankingTpsBins,
|
||||
engineConfiguration->crankingTpsCoef);
|
||||
|
||||
|
||||
/*
|
||||
engine->engineState.cranking.tpsCoefficient =
|
||||
tps.Valid
|
||||
tps.Valid
|
||||
? interpolate2d(tps.Value, engineConfiguration->crankingTpsBins, engineConfiguration->crankingTpsCoef)
|
||||
: 1; // in case of failed TPS, don't correct.*/
|
||||
: 1; // in case of failed TPS, don't correct.
|
||||
|
||||
floatms_t crankingFuel = baseCrankingFuel
|
||||
* engine->engineState.cranking.durationCoefficient
|
||||
|
|
|
@ -1558,7 +1558,7 @@ float[CLT_CURVE_SIZE] cltFuelCorr;;"ratio", 1, 0, 0, 5, 2
|
|||
float[IAT_CURVE_SIZE] iatFuelCorrBins;;"C", 1, 0, -100, 250, 2
|
||||
float[IAT_CURVE_SIZE] iatFuelCorr;;"ratio", 1, 0, 0, 5, 2
|
||||
|
||||
float[CRANKING_CURVE_SIZE] crankingFuelCoef;;"ratio", 1, 0, 0.1, 50, 2
|
||||
float[CRANKING_CURVE_SIZE] crankingFuelCoef;;"ratio", 1, 0, 0, 50, 2
|
||||
float[CRANKING_CURVE_SIZE] crankingFuelBins;;"C", 1, 0, -80, 170, 2
|
||||
|
||||
float[CRANKING_CURVE_SIZE] crankingCycleCoef;;"ratio", 1, 0, 0, 5, 2
|
||||
|
@ -1651,6 +1651,8 @@ cyl_trim_s[12 iterate] ignTrims
|
|||
uint16_t[TRIM_SIZE] fuelTrimLoadBins;;"", 1, 0, 0, 400, 0
|
||||
uint16_t[TRIM_SIZE] fuelTrimRpmBins;;"rpm", 1, 0, 0, 20000, 0
|
||||
cyl_trim_s[12 iterate] fuelTrims
|
||||
|
||||
uint16_t[CRANKING_CURVE_SIZE] crankingFuelCoefE100;;"ratio", 0.01, 0, 0, 50, 2
|
||||
end_struct
|
||||
|
||||
#define MOCK_MAP_COMMAND "mock_map_voltage"
|
||||
|
|
|
@ -496,6 +496,14 @@ enable2ndByteCanID = false
|
|||
yAxis = 0, 3, 10
|
||||
xBins = crankingFuelBins, coolant
|
||||
yBins = crankingFuelCoef
|
||||
gauge = CLTGauge
|
||||
|
||||
curve = crankingCltCurveE100, "Cranking Coolant Temperature Multiplier (Flex Fuel E100)"
|
||||
columnLabel = "Coolant", "Multiplier"
|
||||
xAxis = -40, 120, 9
|
||||
yAxis = 0, 3, 10
|
||||
xBins = crankingFuelBins, coolant
|
||||
yBins = crankingFuelCoefE100
|
||||
gauge = CLTGauge
|
||||
|
||||
curve = etbTpsBiasCurve, "Electronic TB Bias Curve"
|
||||
|
@ -1427,6 +1435,7 @@ menuDialog = main
|
|||
subMenu = std_separator
|
||||
|
||||
subMenu = crankingCltCurve, "Fuel CLT multiplier"
|
||||
subMenu = crankingCltCurveE100, "Fuel CLT multiplier (Flex Fuel E100)", 0, { flexSensorPin != @@ADC_CHANNEL_NONE@@ }
|
||||
subMenu = crankingDurationCurve, "Fuel duration multiplier"
|
||||
subMenu = crankingTpsCurve, "Fuel TPS multiplier"
|
||||
subMenu = std_separator
|
||||
|
|
Loading…
Reference in New Issue