diff --git a/firmware/controllers/algo/airmass/alphan_airmass.cpp b/firmware/controllers/algo/airmass/alphan_airmass.cpp index 9d0a9363f4..58fc4c7973 100644 --- a/firmware/controllers/algo/airmass/alphan_airmass.cpp +++ b/firmware/controllers/algo/airmass/alphan_airmass.cpp @@ -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 { diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 3d95327223..14557176d7 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -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" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 7893e4e8c2..4635952433 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -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 }