Always log normalized cylinder filling

This commit is contained in:
Matthew Kennedy 2023-09-17 02:07:32 -04:00 committed by rusefillc
parent d15eaaf0fa
commit 58b90469cb
3 changed files with 4 additions and 1 deletions

View File

@ -78,7 +78,7 @@ float IFuelComputer::getLoadOverride(float defaultLoad, load_override_e override
// TPS/pedal default to 100% - failed TPS goes rich
case AFR_Tps: return Sensor::get(SensorType::Tps1).value_or(100);
case AFR_AccPedal: return Sensor::get(SensorType::AcceleratorPedal).value_or(100);
case AFR_CylFilling: return 100 * sdAirMassInOneCylinder / getStandardAirCharge();
case AFR_CylFilling: return normalizedCylinderFilling;
default: return 0;
}
}

View File

@ -24,6 +24,7 @@ struct_no_prefix fuel_computer_s
! c'mon, not the whole LiveData spaghetti for SD class?
float sdTcharge_coff
float sdAirMassInOneCylinder;@@GAUGE_NAME_AIR_MASS@@;"g",1, 0, 0, 0, 3
float normalizedCylinderFilling;Air: Normalized cyl filling;"%", 1, 0, 0, 100, 1
bit injectorHwIssue
end_struct

View File

@ -179,7 +179,9 @@ static float getBaseFuelMass(int rpm) {
auto airmass = model->getAirmass(rpm, true);
// Plop some state for others to read
float normalizedCylinderFilling = 100 * airmass.CylinderAirmass / getStandardAirCharge();
engine->fuelComputer.sdAirMassInOneCylinder = airmass.CylinderAirmass;
engine->fuelComputer.normalizedCylinderFilling = normalizedCylinderFilling;
engine->engineState.fuelingLoad = airmass.EngineLoadPercent;
engine->engineState.ignitionLoad = engine->fuelComputer.getLoadOverride(airmass.EngineLoadPercent, engineConfiguration->ignOverrideMode);