diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index 283f92627b..239709b528 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -176,6 +176,8 @@ 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_MAP: return "LM_MAP"; case LM_SPEED_DENSITY: diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 6412a1749c..3270598e1f 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -139,6 +139,8 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_ setDetaultVETable(engineConfiguration); + setBosch0280218037(engineConfiguration); + engineConfiguration->injector.lag = 1.0; engineConfiguration->acCutoffLowRpm = 700; diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 1323918588..851f1362f2 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -185,6 +185,11 @@ typedef enum { */ LM_SPEED_DENSITY = 3, + /** + * MAF with a known kg/hour function + */ + LM_REAL_MAF = 4, + Force_4b_engine_load_mode = ENUM_32_BITS, } engine_load_mode_e; diff --git a/firmware/controllers/sensors/maf.cpp b/firmware/controllers/sensors/maf.cpp index a741bac106..b2fa7bb625 100644 --- a/firmware/controllers/sensors/maf.cpp +++ b/firmware/controllers/sensors/maf.cpp @@ -32,6 +32,7 @@ void setBosch0280218037(engine_configuration_s *engineConfiguration) { while (i < MAF_DECODING_COUNT) { engineConfiguration->mafDecoding[i] = 738; - engineConfiguration->mafDecodingBins[i++] = 4.98046875 + i; + engineConfiguration->mafDecodingBins[i] = 4.98046875 + i; + i++; } } diff --git a/firmware/rusefi_config.ini b/firmware/rusefi_config.ini index 1e1561dac0..836cb1f262 100644 --- a/firmware/rusefi_config.ini +++ b/firmware/rusefi_config.ini @@ -206,7 +206,7 @@ struct trigger_config_s @brief Trigger wheel(s) configuration custom bool32_t 4 bits, U32, @OFFSET@, [0:0], "false", "true" -custom trigger_type_e 4 bits, U32, @OFFSET@, [0:4], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" +custom trigger_type_e 4 bits, U32, @OFFSET@, [0:4], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" trigger_type_e type; bit customIsSynchronizationNeeded; @@ -473,8 +473,8 @@ custom pin_input_mode_e 4 scalar, F32, @OFFSET@, "ms", 1, 0, 0, 200, 1 le_formula_t timingMultiplier; le_formula_t timingAdditive; -float[MAF_DECODING_COUNT] mafDecoding; -float[MAF_DECODING_COUNT] mafDecodingBins; +float[MAF_DECODING_COUNT] mafDecoding;;"kg/hour", 1, 0, -500.0, 4000.0, 2 +float[MAF_DECODING_COUNT] mafDecodingBins;; "V", 1, 0, -5.0, 150.0, 2 fuel_table_t fuelTable; diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index f6d32c0d18..b921b2f164 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -37,7 +37,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated by ConfigDefinition.jar on Wed Feb 11 16:24:33 EST 2015 +; this section was generated by ConfigDefinition.jar on Wed Feb 11 21:39:34 EST 2015 pageSize = 15160 page = 1 @@ -122,7 +122,7 @@ page = 1 tpsAdcChannel = bits, U32, 760, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5" ;skipping overrideCrankingIgnition offset 764 analogChartFrequency = scalar, S32, 768, "index", 1, 0, 0, 300, 0 ; size 4 - trigger_type = bits, U32, 772, [0:4], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" + trigger_type = bits, U32, 772, [0:4], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" trigger_customIsSynchronizationNeeded= bits, U32, 776, [0:0], "false", "true" trigger_customNeedSecondTriggerInput= bits, U32, 776, [1:1], "false", "true" trigger_customTotalToothCount = scalar, S32, 780, "number", 1, 0.0, 0, 1000.0, 2 @@ -460,8 +460,8 @@ page = 1 ;skipping unused3 offset 5204 timingMultiplier = array, U08, 5800, [200],"char", 1, 0, 0.0, 3.0, 2 timingAdditive = array, U08, 6000, [200],"char", 1, 0, 0.0, 3.0, 2 -;skipping mafDecoding offset 6200 -;skipping mafDecodingBins offset 7224 + mafDecoding = array, F32, 6200, [256], "kg/hour", 1, 0, -500.0, 4000.0, 2 + mafDecodingBins = array, F32, 7224, [256], "V", 1, 0, -5.0, 150.0, 2 fuelTable = array, F32, 8248, [16x16],"ms", 1, 0, 0.0, 300.0, 2 fuelLoadBins = array, F32, 9272, [16], "V", 1, 0, 0.0, 300.0, 2 fuelRpmBins = array, F32, 9336, [16], "RPM", 1, 0, 0.0, 25500.0, 2 @@ -514,12 +514,12 @@ fileVersion = { 20150211 } #if CELSIUS coolant = scalar, F32, 4, "°C", 1, 0.0 #else - coolant = scalar, F32, 4, "°F", {1 * 9/5}, 32.0 + coolant = scalar, F32, 4, "°F", {9/5}, 17.77777 #endif #if CELSIUS intake = scalar, F32, 8, "°C", 1, 0.0 #else - intake = scalar, F32, 8, "°F", {1 * 9/5}, 32.0 + intake = scalar, F32, 8, "°F", {9/5}, 17.77777 #endif TPS = scalar, F32, 12, "%", 1, 0 MAF = scalar, F32, 16, "V", 1, 0 @@ -607,6 +607,14 @@ fileVersion = { 20150211 } yBins = injector_battLagCorr gauge = VBattGauge + curve = mafDecodingCurve, "MAF decoding" + columnLabel = "Voltage", "kg/hour" + xAxis = -1, 6, 10 + yAxis = -30, 1300, 10 + xBins = mafDecodingBins, MAF + yBins = mafDecoding + gauge = mafGauge + curve = iatFuelCorrCurve, "Intake air temp fuel correction" columnLabel = "Coolant", "Correction" xAxis = -40, 120, 10 @@ -813,6 +821,7 @@ fileVersion = { 20150211 } subMenu = afrTableTbl, "Targe AFR Table", {algorithm == 3} subMenu = std_separator subMenu = ignitionTableTbl, "Ignition Table" + subMenu = mafDecodingCurve, "MAF Decoding Curve" subMenu = std_separator ; subMenu = otherSettings @@ -859,7 +868,7 @@ fileVersion = { 20150211 } field = "sync Ratio From", trigger_customSyncRatioFrom, {trigger_type == 0} field = "sync Ratio To", trigger_customSyncRatioTo, {trigger_type == 0} field = "use Rise Edge?", trigger_customUseRiseEdge, {trigger_type == 0} - field = "needed Second Trigger Input?", needSecondTriggerInput + field = "needed Second Trigger Input?", trigger_customNeedSecondTriggerInput, {trigger_type == 0} ; Engine->Injection Settings dialog = injChars, "Injector Settings"