add option to temperature compensate alpha-n

This commit is contained in:
Matthew Kennedy 2023-09-16 23:21:03 -07:00
parent 18528d8ca7
commit 17cb1444c7
3 changed files with 9 additions and 2 deletions

View File

@ -13,11 +13,17 @@ AirmassResult AlphaNAirmass::getAirmass(int rpm, bool postState) {
// In this case, VE directly describes the cylinder filling relative to the ideal
float ve = getVe(rpm, tps.Value, postState);
// optionally use real IAT instead of fixed air temperature
constexpr float standardIat = 273.0f + 20.0f; // std atmosphere temperature
float iat = engineConfiguration->alphaNUseIat
? Sensor::get(SensorType::Iat).value_or(standardIat)
: standardIat;
// TODO: should this be barometric pressure and/or temperature compensated?
mass_t airmass = getAirmassImpl(
ve,
101.325f, // std atmosphere pressure
273.0f + 20.0f // std atmosphere pressure
iat
);
return {

View File

@ -844,7 +844,7 @@ sensor_chart_e sensorChartMode;rusEFI console Sensor Sniffer mode;
bit enableSoftwareKnock
bit verboseVVTDecoding;Verbose info in console below engineSnifferRpmThreshold\nenable vvt_details
bit invertCamVVTSignal;get invertCamVVTSignal
bit unused804b12
bit alphaNUseIat;In Alpha-N mode, compensate for air temperature.
bit knockBankCyl1,"Channel 2","Channel 1"
bit knockBankCyl2,"Channel 2","Channel 1"
bit knockBankCyl3,"Channel 2","Channel 1"

View File

@ -2186,6 +2186,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "Enabled", isInjectionEnabled
field = "Mode", injectionMode, {isInjectionEnabled == 1}
field = "#Batch injection with individual wiring"
field = "Alpha-N uses IAT density correction", alphaNUseIat, { fuelAlgorithm == @@engine_load_mode_e_LM_ALPHA_N@@ }
field = "Override VE table load axis", veOverrideMode, { isInjectionEnabled }
field = "Override AFR table load axis", afrOverrideMode, { isInjectionEnabled }
field = "Injection phase control mode", injectionTimingMode, { isInjectionEnabled }