Skip to content

Commit

Permalink
add option to temperature compensate alpha-n
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Sep 17, 2023
1 parent 18528d8 commit 17cb144
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion firmware/controllers/algo/airmass/alphan_airmass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion firmware/integration/rusefi_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions firmware/tunerstudio/rusefi.input
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 17cb144

Please sign in to comment.