totalFuel and totalIgnition correction gauges in Tunerstudio #4955
This commit is contained in:
parent
c75890c745
commit
0c1859b77e
|
@ -579,7 +579,7 @@ static void updateFuelResults() {
|
|||
engine->outputChannels.chargeAirMass = engine->fuelComputer.sdAirMassInOneCylinder;
|
||||
|
||||
engine->outputChannels.baseFuel = engine->engineState.baseFuel * 1000; // Convert grams to mg
|
||||
engine->outputChannels.fuelRunning = engine->engineState.running.fuel;
|
||||
engine->outputChannels.fuelRunning = engine->fuelComputer.running.fuel;
|
||||
|
||||
engine->outputChannels.fuelFlowRate = engine->engineState.fuelConsumption.getConsumptionGramPerSecond();
|
||||
engine->outputChannels.totalFuelConsumption = engine->engineState.fuelConsumption.getConsumedGrams();
|
||||
|
|
|
@ -122,7 +122,7 @@ void EngineState::periodicFastCallback() {
|
|||
crankingTimer.reset(nowNt);
|
||||
}
|
||||
|
||||
running.timeSinceCrankingInSecs = crankingTimer.getElapsedSeconds(nowNt);
|
||||
engine->fuelComputer.running.timeSinceCrankingInSecs = crankingTimer.getElapsedSeconds(nowNt);
|
||||
|
||||
recalculateAuxValveTiming();
|
||||
|
||||
|
@ -131,9 +131,9 @@ void EngineState::periodicFastCallback() {
|
|||
dwellAngle = cisnan(rpm) ? NAN : sparkDwell / getOneDegreeTimeMs(rpm);
|
||||
|
||||
// todo: move this into slow callback, no reason for IAT corr to be here
|
||||
running.intakeTemperatureCoefficient = getIatFuelCorrection();
|
||||
engine->fuelComputer.running.intakeTemperatureCoefficient = getIatFuelCorrection();
|
||||
// todo: move this into slow callback, no reason for CLT corr to be here
|
||||
running.coolantTemperatureCoefficient = getCltFuelCorrection();
|
||||
engine->fuelComputer.running.coolantTemperatureCoefficient = getCltFuelCorrection();
|
||||
|
||||
engine->module<DfcoController>()->update();
|
||||
|
||||
|
@ -141,10 +141,10 @@ void EngineState::periodicFastCallback() {
|
|||
// for compatibility reasons, apply only if the factor is greater than unity (only allow adding fuel)
|
||||
if (engineConfiguration->postCrankingFactor > 1.0f) {
|
||||
// use interpolation for correction taper
|
||||
running.postCrankingFuelCorrection = interpolateClamped(0.0f, engineConfiguration->postCrankingFactor,
|
||||
engineConfiguration->postCrankingDurationSec, 1.0f, running.timeSinceCrankingInSecs);
|
||||
engine->fuelComputer.running.postCrankingFuelCorrection = interpolateClamped(0.0f, engineConfiguration->postCrankingFactor,
|
||||
engineConfiguration->postCrankingDurationSec, 1.0f, engine->fuelComputer.running.timeSinceCrankingInSecs);
|
||||
} else {
|
||||
running.postCrankingFuelCorrection = 1.0f;
|
||||
engine->fuelComputer.running.postCrankingFuelCorrection = 1.0f;
|
||||
}
|
||||
|
||||
cltTimingCorrection = getCltTimingCorrection();
|
||||
|
|
|
@ -61,21 +61,6 @@ end_struct
|
|||
cranking_fuel_s crankingFuel
|
||||
|
||||
|
||||
|
||||
struct running_fuel_s
|
||||
float postCrankingFuelCorrection
|
||||
float intakeTemperatureCoefficient;@@GAUGE_NAME_FUEL_IAT_CORR@@
|
||||
float coolantTemperatureCoefficient;@@GAUGE_NAME_FUEL_CLT_CORR@@
|
||||
float timeSinceCrankingInSecs
|
||||
|
||||
floatms_t baseFuel;
|
||||
floatms_t fuel;Fuel: actual\nActual injection duration with CLT, IAT and TPS acceleration corrections per cycle, as squirt duration.\nWithout injector lag.\n@see baseFuel\n@see actualLastInjection
|
||||
! end of running_fuel_s structure definition
|
||||
end_struct
|
||||
|
||||
! actually define a member of 'running_fuel_s' type
|
||||
running_fuel_s running
|
||||
|
||||
custom percent_t 4 scalar, F32, @OFFSET@, "", 1, 0, 0, 100, 2
|
||||
|
||||
! spark-related
|
||||
|
|
|
@ -1,5 +1,20 @@
|
|||
struct_no_prefix fuel_computer_s
|
||||
|
||||
float totalFuelCorrection
|
||||
struct running_fuel_s
|
||||
float postCrankingFuelCorrection
|
||||
float intakeTemperatureCoefficient;@@GAUGE_NAME_FUEL_IAT_CORR@@
|
||||
float coolantTemperatureCoefficient;@@GAUGE_NAME_FUEL_CLT_CORR@@
|
||||
float timeSinceCrankingInSecs
|
||||
|
||||
floatms_t baseFuel;
|
||||
floatms_t fuel;Fuel: actual\nActual injection duration with CLT, IAT and TPS acceleration corrections per cycle, as squirt duration.\nWithout injector lag.\n@see baseFuel\n@see actualLastInjection
|
||||
! end of running_fuel_s structure definition
|
||||
end_struct
|
||||
|
||||
! actually define a member of 'running_fuel_s' type
|
||||
running_fuel_s running
|
||||
|
||||
uint16_t autoscale afrTableYAxis;;"%",{1/100}, 0, 0, 0, 0
|
||||
uint16_t autoscale targetLambda;@@GAUGE_NAME_TARGET_LAMBDA@@;"",{1/@@PACK_MULT_LAMBDA@@}, 0, 0, 0, 3
|
||||
uint16_t autoscale targetAFR;@@GAUGE_NAME_TARGET_AFR@@;"ratio",{1/@@PACK_MULT_AFR@@}, 0, 0, 0, 2
|
||||
|
|
|
@ -113,13 +113,13 @@ float getCrankingFuel3(
|
|||
float getRunningFuel(float baseFuel) {
|
||||
ScopePerf perf(PE::GetRunningFuel);
|
||||
|
||||
engine->engineState.running.baseFuel = baseFuel;
|
||||
engine->fuelComputer.running.baseFuel = baseFuel;
|
||||
|
||||
float iatCorrection = engine->engineState.running.intakeTemperatureCoefficient;
|
||||
float iatCorrection = engine->fuelComputer.running.intakeTemperatureCoefficient;
|
||||
|
||||
float cltCorrection = engine->engineState.running.coolantTemperatureCoefficient;
|
||||
float cltCorrection = engine->fuelComputer.running.coolantTemperatureCoefficient;
|
||||
|
||||
float postCrankingFuelCorrection = engine->engineState.running.postCrankingFuelCorrection;
|
||||
float postCrankingFuelCorrection = engine->fuelComputer.running.postCrankingFuelCorrection;
|
||||
|
||||
float baroCorrection = engine->engineState.baroCorrection;
|
||||
|
||||
|
@ -143,7 +143,7 @@ float getRunningFuel(float baseFuel) {
|
|||
|
||||
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(runningFuel), "NaN runningFuel", 0);
|
||||
|
||||
engine->engineState.running.fuel = runningFuel * 1000;
|
||||
engine->fuelComputer.running.fuel = runningFuel * 1000;
|
||||
|
||||
return runningFuel;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ static bool shouldCorrect() {
|
|||
}
|
||||
|
||||
// Startup delay - allow O2 sensor to warm up, etc
|
||||
if (cfg.startupDelay > engine->engineState.running.timeSinceCrankingInSecs) {
|
||||
if (cfg.startupDelay > engine->fuelComputer.running.timeSinceCrankingInSecs) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -532,8 +532,8 @@ static void setTestBug299(EngineTestHelper *eth) {
|
|||
ASSERT_EQ( 0, eth->executeActions()) << "exec#3";
|
||||
|
||||
|
||||
ASSERT_EQ( 1, engine->engineState.running.intakeTemperatureCoefficient) << "iatC";
|
||||
ASSERT_EQ( 1, engine->engineState.running.coolantTemperatureCoefficient) << "cltC";
|
||||
ASSERT_EQ( 1, engine->fuelComputer.running.intakeTemperatureCoefficient) << "iatC";
|
||||
ASSERT_EQ( 1, engine->fuelComputer.running.coolantTemperatureCoefficient) << "cltC";
|
||||
ASSERT_EQ( 0, engine->module<InjectorModel>()->getDeadtime()) << "lag";
|
||||
|
||||
ASSERT_EQ( 3000, round(Sensor::getOrZero(SensorType::Rpm))) << "setTestBug299: RPM";
|
||||
|
|
Loading…
Reference in New Issue