From 67e4fcb2a2f89426b2d135b294643ec7a6bc09ac Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Thu, 23 Jul 2020 02:46:45 -0700 Subject: [PATCH] goodbye plain maf --- .../config/controllers/algo/auto_generated_enums.cpp | 2 -- firmware/config/engines/ford_festiva.cpp | 2 -- firmware/config/engines/mazda_miata_1_6.cpp | 2 -- firmware/controllers/algo/auto_generated_enums.cpp | 2 -- firmware/controllers/algo/engine_configuration.cpp | 2 +- firmware/controllers/algo/rusefi_enums.h | 4 ---- firmware/controllers/math/engine_math.cpp | 9 +-------- firmware/integration/rusefi_config.txt | 2 +- firmware/tunerstudio/rusefi.input | 12 ------------ 9 files changed, 3 insertions(+), 34 deletions(-) diff --git a/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp b/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp index c1716c340d..c27c61ccc1 100644 --- a/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp +++ b/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp @@ -589,8 +589,6 @@ case Force_4_bytes_size_engine_load_mode: return "Force_4_bytes_size_engine_load_mode"; case LM_ALPHA_N: return "LM_ALPHA_N"; -case LM_PLAIN_MAF: - return "LM_PLAIN_MAF"; case LM_REAL_MAF: return "LM_REAL_MAF"; case LM_SPEED_DENSITY: diff --git a/firmware/config/engines/ford_festiva.cpp b/firmware/config/engines/ford_festiva.cpp index 894c37bd51..5749b1953f 100644 --- a/firmware/config/engines/ford_festiva.cpp +++ b/firmware/config/engines/ford_festiva.cpp @@ -80,9 +80,7 @@ void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->globalFuelCorrection = 0.75; engineConfiguration->specs.displacement = 1.839; -// engineConfiguration->fuelAlgorithm = LM_PLAIN_MAF; setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); -// engineConfiguration->fuelAlgorithm = LM_REAL_MAF; setFuelLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); setFuelRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); diff --git a/firmware/config/engines/mazda_miata_1_6.cpp b/firmware/config/engines/mazda_miata_1_6.cpp index 8589389cee..0089e1b821 100644 --- a/firmware/config/engines/mazda_miata_1_6.cpp +++ b/firmware/config/engines/mazda_miata_1_6.cpp @@ -291,7 +291,6 @@ void setMiataNA6_MAP_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) { void setMiataNA6_VAF_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setMiataNA6_MAP_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE); - engineConfiguration->fuelAlgorithm = LM_PLAIN_MAF; /** * Stage 0 we only have OEM TPS switch @@ -349,6 +348,5 @@ void setMiataNA6_VAF_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setMiataNA6_settings(PASS_CONFIG_PARAMETER_SIGNATURE); miataNAcommonEngineSettings(PASS_CONFIG_PARAMETER_SIGNATURE); - engineConfiguration->fuelAlgorithm = LM_PLAIN_MAF; #endif /* BOARD_TLE8888_COUNT */ } diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index 0b31355cb7..96d088be81 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -727,8 +727,6 @@ case Force_4_bytes_size_engine_load_mode: return "Force_4_bytes_size_engine_load_mode"; case LM_ALPHA_N: return "LM_ALPHA_N"; -case LM_PLAIN_MAF: - return "LM_PLAIN_MAF"; case LM_REAL_MAF: return "LM_REAL_MAF"; case LM_SPEED_DENSITY: diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index a5a558e59c..722424432b 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -979,7 +979,7 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->ignitionOffset = 0; engineConfiguration->sensorChartFrequency = 20; - engineConfiguration->fuelAlgorithm = LM_PLAIN_MAF; + engineConfiguration->fuelAlgorithm = LM_SPEED_DENSITY; engineConfiguration->vbattDividerCoeff = ((float) (15 + 65)) / 15; diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index ed4f81e8d2..37053e06e1 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -424,10 +424,6 @@ typedef enum { * This enum is used to select your desired Engine Load calculation algorithm */ typedef enum { - /** - * raw Mass Air Flow sensor value algorithm. http://en.wikipedia.org/wiki/Mass_flow_sensor - */ - LM_PLAIN_MAF = 0, /** * Throttle Position Sensor value is used as engine load. http://en.wikipedia.org/wiki/Throttle_position_sensor */ diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index 6c8a3b5648..f6774fcec9 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -65,13 +65,6 @@ float getEngineLoadT(DECLARE_ENGINE_PARAMETER_SIGNATURE) { efiAssert(CUSTOM_ERR_ASSERT, engine!=NULL, "engine 2NULL", NAN); efiAssert(CUSTOM_ERR_ASSERT, engineConfiguration!=NULL, "engineConfiguration 2NULL", NAN); switch (engineConfiguration->fuelAlgorithm) { - case LM_PLAIN_MAF: - if (!hasMafSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) { - // todo: make this not happen during hardware CI - warning(CUSTOM_MAF_NEEDED, "MAF sensor needed for current fuel algorithm"); - return NAN; - } - return getMafVoltage(PASS_ENGINE_PARAMETER_SIGNATURE); case LM_SPEED_DENSITY: return getMap(PASS_ENGINE_PARAMETER_SIGNATURE); case LM_ALPHA_N: @@ -80,7 +73,7 @@ float getEngineLoadT(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return getRealMaf(PASS_ENGINE_PARAMETER_SIGNATURE); default: firmwareError(CUSTOM_UNKNOWN_ALGORITHM, "Unexpected engine load parameter: %d", engineConfiguration->fuelAlgorithm); - return -1; + return 0; } } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index c443ec0b74..10d2d826b6 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -457,7 +457,7 @@ int sensorSnifferRpmThreshold;+Disable sensor sniffer above this rpm;"RPM", int rpmHardLimit;set rpm_hard_limit X;"rpm", 1, 0, 0, 20000.0, 2 -#define engine_load_mode_e_enum "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge", "INVALID", "INVALID" +#define engine_load_mode_e_enum "INVALID", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge", "INVALID", "INVALID" custom engine_load_mode_e 4 bits, U32, @OFFSET@, [0:2], @@engine_load_mode_e_enum@@ diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 2bcc8400ac..ba7a7cfdb7 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -354,7 +354,6 @@ enable2ndByteCanID = false ; ; todo: generate this section programatically - LM_PLAIN_MAF = {0}, LM_ALPHA_N = {1}, LM_SPEED_DENSITY = {3}, LM_REAL_MAF = {4} @@ -706,16 +705,6 @@ enable2ndByteCanID = false [TableEditor] ; table_id, map3d_id, "title", page - table = fuelTableMAFTbl, fuelTableMAFMap, "Fuel Table", 1 - topicHelp = "fuelHelp" - ; constant, variable - xBins = fuelRpmBins, RPMValue - yBins = fuelLoadBins, MAFValue - zBins = fuelTable -; gridHeight = 2.0 - gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. - upDownLabel = "(RICHER)", "(LEANER)" - table = fuelTableTPSTbl, fuelTableTPSMap, "Fuel Table", 1 topicHelp = "fuelHelp" ; constant, variable @@ -1514,7 +1503,6 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" [UserDefined] dialog = fuelTableBottomDialog, "", card - panel = fuelTableMAFTbl, Center, {fuelAlgorithm==LM_PLAIN_MAF} panel = fuelTableTPSTbl, Center, {fuelAlgorithm==LM_ALPHA_N} panel = fuelTableELTbl, Center