From 0e70d08a229be5f5ea374b9ec11b66a4350499c1 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sun, 31 Jan 2021 14:19:06 -0800 Subject: [PATCH] Add fallback map table (#2248) * table * sd math * config * debug channel name * ptr vs not ptr * actually use return value * memory * less magic --- .../algo/airmass/speed_density_airmass.cpp | 20 ++++++++++- .../algo/airmass/speed_density_airmass.h | 11 +++++- firmware/controllers/algo/fuel_math.cpp | 5 ++- firmware/controllers/algo/rusefi_types.h | 1 + firmware/controllers/engine_controller.cpp | 2 +- firmware/integration/rusefi_config.txt | 18 +++++----- firmware/tunerstudio/rusefi.input | 36 +++++++++++-------- firmware/util/containers/table_helper.h | 1 + 8 files changed, 67 insertions(+), 27 deletions(-) diff --git a/firmware/controllers/algo/airmass/speed_density_airmass.cpp b/firmware/controllers/algo/airmass/speed_density_airmass.cpp index 860e871936..786fbb06da 100644 --- a/firmware/controllers/algo/airmass/speed_density_airmass.cpp +++ b/firmware/controllers/algo/airmass/speed_density_airmass.cpp @@ -17,7 +17,7 @@ AirmassResult SpeedDensityAirmass::getAirmass(int rpm) { return {}; } - auto map = Sensor::get(SensorType::Map).value_or(CONFIG(failedMapFallback)); + auto map = getMap(rpm); engine->engineState.sd.manifoldAirPressureAccelerationAdjustment = engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE); @@ -41,3 +41,21 @@ AirmassResult SpeedDensityAirmass::getAirmass(int rpm) { map, // AFR/VE table Y axis }; } + +float SpeedDensityAirmass::getMap(int rpm) const { + float fallbackMap; + if (CONFIG(enableMapEstimationTableFallback)) { + // if the map estimation table is enabled, estimate map based on the TPS and RPM + fallbackMap = m_mapEstimationTable->getValue(rpm, TPS_2_BYTE_PACKING_MULT * Sensor::get(SensorType::Tps1).value_or(0)); + } else { + fallbackMap = CONFIG(failedMapFallback); + } + +#if EFI_TUNER_STUDIO + if (CONFIG(debugMode) == DBG_MAP) { + tsOutputChannels.debugFloatField4 = fallbackMap; + } +#endif // EFI_TUNER_STUDIO + + return Sensor::get(SensorType::Map).value_or(fallbackMap); +} diff --git a/firmware/controllers/algo/airmass/speed_density_airmass.h b/firmware/controllers/algo/airmass/speed_density_airmass.h index d59fb9804d..2ccee63630 100644 --- a/firmware/controllers/algo/airmass/speed_density_airmass.h +++ b/firmware/controllers/algo/airmass/speed_density_airmass.h @@ -4,6 +4,15 @@ class SpeedDensityAirmass : public SpeedDensityBase { public: - explicit SpeedDensityAirmass(const ValueProvider3D& veTable) : SpeedDensityBase(veTable) {} + explicit SpeedDensityAirmass(const ValueProvider3D& veTable, const ValueProvider3D& mapEstimationTable) + : SpeedDensityBase(veTable) + , m_mapEstimationTable(&mapEstimationTable) + {} + AirmassResult getAirmass(int rpm) override; + + float getMap(int rpm) const; + +private: + const ValueProvider3D* const m_mapEstimationTable; }; diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index 9fa34bc00b..971b35919d 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -45,6 +45,7 @@ fuel_Map3D_t fuelPhaseMap("fl ph"); extern fuel_Map3D_t veMap; extern lambda_Map3D_t lambdaMap; extern baroCorr_Map3D_t baroCorrMap; +mapEstimate_Map3D_t mapEstimationTable("map est"); #if EFI_ENGINE_CONTROL @@ -160,7 +161,7 @@ floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX) { /* DISPLAY_ENDIF */ -static SpeedDensityAirmass sdAirmass(veMap); +static SpeedDensityAirmass sdAirmass(veMap, mapEstimationTable); static MafAirmass mafAirmass(veMap); static AlphaNAirmass alphaNAirmass(veMap); @@ -350,6 +351,8 @@ void initFuelMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) { ENGINE(fuelComputer) = &fuelComputer; ENGINE(injectorModel) = &injectorModel; + mapEstimationTable.init(config->mapEstimateTable, config->mapEstimateTpsBins, config->mapEstimateRpmBins); + #if (IGN_LOAD_COUNT == FUEL_LOAD_COUNT) && (IGN_RPM_COUNT == FUEL_RPM_COUNT) fuelPhaseMap.init(config->injectionPhase, config->injPhaseLoadBins, config->injPhaseRpmBins); #endif /* (IGN_LOAD_COUNT == FUEL_LOAD_COUNT) && (IGN_RPM_COUNT == FUEL_RPM_COUNT) */ diff --git a/firmware/controllers/algo/rusefi_types.h b/firmware/controllers/algo/rusefi_types.h index 3fb56f4cd9..7e41ff4c12 100644 --- a/firmware/controllers/algo/rusefi_types.h +++ b/firmware/controllers/algo/rusefi_types.h @@ -92,6 +92,7 @@ typedef brain_pin_e egt_cs_array_t[EGT_CHANNEL_COUNT]; typedef uint8_t lambda_table_t[FUEL_LOAD_COUNT][FUEL_RPM_COUNT]; // todo: merge these two types together? but these tables have different TS parameters like ranges etc typedef float fuel_table_t[FUEL_LOAD_COUNT][FUEL_RPM_COUNT]; +typedef uint16_t map_estimate_table_t[FUEL_LOAD_COUNT][FUEL_RPM_COUNT]; typedef float ignition_table_t[IGN_LOAD_COUNT][IGN_RPM_COUNT]; typedef int16_t ignition_tps_table_t[IGN_LOAD_COUNT][IGN_RPM_COUNT]; typedef uint8_t pedal_to_tps_t[PEDAL_TO_TPS_SIZE][PEDAL_TO_TPS_SIZE]; diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index f5733a7828..d49a8cf022 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -711,7 +711,7 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) * UNUSED_SIZE constants. */ #ifndef RAM_UNUSED_SIZE -#define RAM_UNUSED_SIZE 3300 +#define RAM_UNUSED_SIZE 3200 #endif #ifndef CCM_UNUSED_SIZE #define CCM_UNUSED_SIZE 2800 diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 5bcb791e13..5f7c63349a 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -185,6 +185,7 @@ struct_no_prefix engine_configuration_s #define PACK_MULT_VOLTAGE 1000 #define PACK_MULT_MASS_FLOW 10 #define TPS_1_BYTE_PACKING_MULT 2 +#define TPS_2_BYTE_PACKING_MULT 100 #define LOAD_1_BYTE_PACKING_MULT 2 #define PACK_MULT_AFR_CFG 10 #define PACK_MULT_LAMBDA_CFG 147 @@ -210,7 +211,9 @@ struct_no_prefix engine_configuration_s #define AFTERSTART_DECAY_CURVE_SIZE 8 #define AFTERSTART_ENRICH_CURVE_SIZE 8 -custom fuel_table_t 4*@@FUEL_RPM_COUNT@@x@@FUEL_LOAD_COUNT@@ array, F32, @OFFSET@, [@@FUEL_RPM_COUNT@@x@@FUEL_LOAD_COUNT@@],"ms", 1, 0, 0.0, 500.0, 2 +#define PACK_MULT_MAP_ESTIMATE 100 + +custom map_estimate_table_t 2*@@FUEL_RPM_COUNT@@x@@FUEL_LOAD_COUNT@@ array, U16, @OFFSET@, [@@FUEL_RPM_COUNT@@x@@FUEL_LOAD_COUNT@@],"kPa", {1/@@PACK_MULT_MAP_ESTIMATE@@}, 0, 0.0, 100.0, 2 custom ve_table_t 4*@@FUEL_RPM_COUNT@@x@@FUEL_LOAD_COUNT@@ array, F32, @OFFSET@, [@@FUEL_RPM_COUNT@@x@@FUEL_LOAD_COUNT@@],"%", 1, 0, 0, 999.0, 2 custom lambda_table_t @@FUEL_RPM_COUNT@@x@@FUEL_LOAD_COUNT@@ array, U08, @OFFSET@, [@@FUEL_RPM_COUNT@@x@@FUEL_LOAD_COUNT@@],"deg", {1/@@PACK_MULT_LAMBDA_CFG@@}, 0, 0.6, 1.5, 2 custom afr_table_t @@FUEL_RPM_COUNT@@x@@FUEL_LOAD_COUNT@@ array, U08, @OFFSET@, [@@FUEL_RPM_COUNT@@x@@FUEL_LOAD_COUNT@@],"deg", {1/@@PACK_MULT_AFR_CFG@@}, 0, 0, 25.0, 1 @@ -517,7 +520,7 @@ bit antiLagEnabled; bit useRunningMathForCranking,"Fuel Map","Fixed"; bit displayLogicLevelsInEngineSniffer; bit useTLE8888_stepper; -bit issue_294_27; +bit enableMapEstimationTableFallback;+If enabled, the MAP estimate table will be used if the MAP sensor fails to estimate manifold pressure based on RPM and TPS. bit issue_294_28; bit issue_294_29; bit issue_294_30; @@ -1545,7 +1548,11 @@ tcubinary_table_t tcuSolenoidTable; float vssFilterReciprocal;+Good example: number of tooth on wheel, For Can 10 is a good number.;"Hz", 1, 0, 2.0, 20.0, 2 -uint8_t[1088] unused15136;;"units", 1, 0, -20, 100, 0 +map_estimate_table_t mapEstimateTable; +uint16_t[FUEL_LOAD_COUNT] mapEstimateTpsBins;;"% TPS", {1/@@TPS_2_BYTE_PACKING_MULT@@}, 0.0, 0, 100.0, 1 +uint16_t[FUEL_RPM_COUNT] mapEstimateRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 0 + +uint8_t[512] unused15136;;"units", 1, 0, -20, 100, 0 ignition_table_t ignitionTable; float[IGN_LOAD_COUNT] ignitionLoadBins;;"Load", 1, 0.0, 0, 500.0, 2 @@ -1556,14 +1563,9 @@ float[FUEL_LOAD_COUNT] veLoadBins;;"kPa", 1, 0.0, 0, 400.0, 2 float[FUEL_RPM_COUNT] veRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2 lambda_table_t lambdaTable; - float[FUEL_LOAD_COUNT] lambdaLoadBins;;"", 1, 0.0, 0, 500.0, 2 float[FUEL_RPM_COUNT] lambdaRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2 -! ve_table_t ve2Table; -! float[FUEL_LOAD_COUNT] ve2LoadBins;;"kPa", 1, 0.0, 0, 500.0, 2 -! float[FUEL_RPM_COUNT] ve2RpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2 - tps_tps_table_t tpsTpsAccelTable; float[TPS_TPS_ACCEL_TABLE] tpsTpsAccelFromRpmBins;;"from", 1, 0, 0.0, 30000.0, 2 float[TPS_TPS_ACCEL_TABLE] tpsTpsAccelToRpmBins;RPM is float and not integer in order to use unified methods for interpolation;"to", 1, 0, 0.0, 25500.0, 2 diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 3e239d50a6..646b0b78f1 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -430,22 +430,22 @@ enable2ndByteCanID = false ; wall of debug mode :) ; https://rusefi.com/wiki/index.php?title=Manual:Debug_fields -; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 -; Alternator TPS Acceleration GPPWM Idle Engine Load Acc Trigger Counters VVT Cranking Ignition Timing Fu Corr VSS SD Card Knock ETB PID Executor InstantRpm FSIO_1_7 CJ125 CAN TLE8888 Analog inputs 2 Boost Start Launcher ETB Autotune FSIO_8_14 FSIO_SPECIAL Injector flow compensation DYNO_VIEW LOGIC_ANALYZER Wideband TCU DBG_48 +; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 +; Alternator TPS Acceleration GPPWM Idle Engine Load Acc Trigger Counters VVT Cranking Ignition Timing Fu Corr VSS SD Card Knock ETB PID Executor InstantRpm FSIO_1_7 CJ125 CAN MAP TLE8888 Analog inputs 2 Boost Start Launcher ETB Autotune FSIO_8_14 FSIO_SPECIAL Injector flow compensation DYNO_VIEW LOGIC_ANALYZER Wideband TCU DBG_48 ; DBG_ALTERNATOR_PID DBG_TPS_ACCEL DBG_GPPWM DBG_IDLE_CONTROL - debugFieldF1List = bits, U08, [0:7], "Controller Output", "From TPS", "GPPWM 1", "Controller Output", "Idle output", "Channel 1 Rise Counter", "", "", "VVT Event Position","", "Ign IAT Corr", "", "", "Total SD", "", "", "", "ETB Controller Output", "", "", "df1", "df1", "InstantRpm", "fsio 1", "24:df1", "CJ125: output", "", "", "", "", "", "", "TPS1 Pri/Sec Diff", "", "", "", "Boost Open Loop Duty", "S unused" "", "Osc Amplitude", "", "fsio 8", "idle offset", "Pressure across injector(kpa)", "VSS", "", "WB: Pump DAC duty", "", "" - debugFieldF2List = bits, U08, [0:7], "I-Term", "To TPS", "GPPWM 2", "I-Term", "Idle df2", "Channel 2 Rise Counter", "", "", "VVT Ratio", "", "Ign CLT Corr", "", "", "Write Cnt","", "", "", "ETB I-Term", "", "", "df2", "df2", "dRpm", "fsio 2", "24:df2", "CJ125: i-term", "", "", "", "", "", "", "TPS2 Pri/Sec Diff", "", "", "", "Boost Closed Loop Duty","S unused" "", "Duty Amplitude", "", "fsio 9", "idle min", "Pressure ratio vs. nominal", "Speed", "", "WB: ESR", "", "" - debugFieldF3List = bits, U08, [0:7], "Previous Error", "Current TPS<>TPS", "GPPWM 3", "prev error", "Idle df3", "ICU sum", "", "", "", "", "Ign FSIO Adj", "", "", "Sync Cnt", "", "", "", "ETB err", "", "", "df3", "df3", "22df3", "fsio 3", "24:df3", "CJ125: err", "", "", "", "", "", "", "TPS1/2 Diff", "", "", "", "", "S unused" "", "Tu", "", "fsio 10", "", "Flow ratio vs. configured", "DeltaSpeed", "", "WB: Heater duty", "", "" - debugFieldF4List = bits, U08, [0:7], "I Gain", "Extra Fuel", "GPPWM 4", "I Gain", "Idle df4", "VVT rise", "", "", "", "", "Ign PID Adj", "", "", "File Cnt", "", "", "", "ETB I setting", "", "", "df4", "df4", "22df4", "fsio 4", "24:df4", "CJ125: UA", "", "", "", "", "", "", "Acc Pedal Pri/Sec Diff","", "", "", "", "S unused" "", "Ku", "", "fsio 11", "", "", "accel", "", "WB: Lambda", "", "" - debugFieldF5List = bits, U08, [0:7], "D Gain", "df5", "df5", "D Gain", "Idle df5", "VVT fall", "df5", "", "", "", "", "", "", "", "", "", "", "ETB D setting", "df5", "df5", "df5", "df5", "22df5", "fsio 5", "24:df5", "CJ125: UR", "", "", "", "", "", "", "", "", "", "", "", "S unused" "", "Kp", "", "fsio 12", "", "", "", "", "", "", "" - debugFieldF6List = bits, U08, [0:7], "D Term", "", "", "D Term", "Idle df6", "Current Gap", "", "", "", "", "", "", "", "", "", "", "", "ETB df6", "", "", "df6", "df6", "22df6", "fsio 6", "24:df6", "cj: f7", "", "", "", "", "", "", "", "", "", "", "", "S unused" "", "Ki", "", "fsio 13", "", "", "", "", "", "", "" - debugFieldF7List = bits, U08, [0:7], "Max-Value", "", "", "Max-Value", "Idle df7", "", "", "", "", "", "", "", "", "", "", "", "", "ETB df7", "", "", "df7", "df7", "22df7", "fsio 7", "24:df7", "cj: f7", "", "", "", "", "", "", "", "", "", "", "", "S unused" "", "Kd", "", "fsio 14", "", "", "", "", "", "", "" + debugFieldF1List = bits, U08, [0:7], "Controller Output", "From TPS", "GPPWM 1", "Controller Output", "Idle output", "Channel 1 Rise Counter", "", "", "VVT Event Position","", "Ign IAT Corr", "", "", "Total SD", "", "", "", "ETB Controller Output", "", "", "df1", "df1", "InstantRpm", "fsio 1", "24:df1", "CJ125: output", "", "", "", "", "", "", "TPS1 Pri/Sec Diff", "", "", "", "Boost Open Loop Duty", "S unused" "", "Osc Amplitude", "", "fsio 8", "idle offset", "Pressure across injector(kpa)", "VSS", "", "WB: Pump DAC duty", "", "" + debugFieldF2List = bits, U08, [0:7], "I-Term", "To TPS", "GPPWM 2", "I-Term", "Idle df2", "Channel 2 Rise Counter", "", "", "VVT Ratio", "", "Ign CLT Corr", "", "", "Write Cnt","", "", "", "ETB I-Term", "", "", "df2", "df2", "dRpm", "fsio 2", "24:df2", "CJ125: i-term", "", "", "", "", "", "", "TPS2 Pri/Sec Diff", "", "", "", "Boost Closed Loop Duty","S unused" "", "Duty Amplitude", "", "fsio 9", "idle min", "Pressure ratio vs. nominal", "Speed", "", "WB: ESR", "", "" + debugFieldF3List = bits, U08, [0:7], "Previous Error", "Current TPS<>TPS", "GPPWM 3", "prev error", "Idle df3", "ICU sum", "", "", "", "", "Ign FSIO Adj", "", "", "Sync Cnt", "", "", "", "ETB err", "", "", "df3", "df3", "22df3", "fsio 3", "24:df3", "CJ125: err", "", "", "", "", "", "", "TPS1/2 Diff", "", "", "", "", "S unused" "", "Tu", "", "fsio 10", "", "Flow ratio vs. configured", "DeltaSpeed", "", "WB: Heater duty", "", "" + debugFieldF4List = bits, U08, [0:7], "I Gain", "Extra Fuel", "GPPWM 4", "I Gain", "Idle df4", "VVT rise", "", "", "", "", "Ign PID Adj", "", "", "File Cnt", "", "", "", "ETB I setting", "", "", "df4", "df4", "22df4", "fsio 4", "24:df4", "CJ125: UA", "", "MAP Estimate", "", "", "", "", "Acc Pedal Pri/Sec Diff","", "", "", "", "S unused" "", "Ku", "", "fsio 11", "", "", "accel", "", "WB: Lambda", "", "" + debugFieldF5List = bits, U08, [0:7], "D Gain", "df5", "df5", "D Gain", "Idle df5", "VVT fall", "df5", "", "", "", "", "", "", "", "", "", "", "ETB D setting", "df5", "df5", "df5", "df5", "22df5", "fsio 5", "24:df5", "CJ125: UR", "", "", "", "", "", "", "", "", "", "", "", "S unused" "", "Kp", "", "fsio 12", "", "", "", "", "", "", "" + debugFieldF6List = bits, U08, [0:7], "D Term", "", "", "D Term", "Idle df6", "Current Gap", "", "", "", "", "", "", "", "", "", "", "", "ETB df6", "", "", "df6", "df6", "22df6", "fsio 6", "24:df6", "cj: f7", "", "", "", "", "", "", "", "", "", "", "", "S unused" "", "Ki", "", "fsio 13", "", "", "", "", "", "", "" + debugFieldF7List = bits, U08, [0:7], "Max-Value", "", "", "Max-Value", "Idle df7", "", "", "", "", "", "", "", "", "", "", "", "", "ETB df7", "", "", "df7", "df7", "22df7", "fsio 7", "24:df7", "cj: f7", "", "", "", "", "", "", "", "", "", "", "", "S unused" "", "Kd", "", "fsio 14", "", "", "", "", "", "", "" - debugFieldI1List = bits, U08, [0:7], "P-Gain", "", "", "P-Gain", "Idle di1", "Channel 1 Fall Counter", "", "", "VVT Sync Counter", "Cycle Counter", "Multispark Count", "", "", "", "", "", "", "ETB P-Gain", "t counter", "", "di1", "di1", "22di1", "", "24:di1", "CJ125: state", "read count","", "", "", "", "SPI Counter", "", "", "", "", "", "Start Count", "", "", "", "", "", "", "deltatime", "", "", "Solenoid 1 State", "" - debugFieldI2List = bits, U08, [0:7], "Offset", "", "", "Offset", "Idle di2", "Channel 2 Fall Counter", "", "", "", "", "", "", "", "", "", "", "", "ETB di2", "invocationcounter", "", "di2", "di2", "22di2", "", "24:di2", "", "write count","", "", "", "", "Latest Transmit","", "", "", "", "", "Starter Enable", "", "", "", "", "", "", "", "", "", "Solenoid 2 State", "" - debugFieldI3List = bits, U08, [0:7], "Reset Cnt", "", "", "Reset Cnt", "Idle di3", "Cycle Index", "", "", "", "", "", "", "", "", "", "", "", "ETB di3", "s counter", "", "di3", "di3", "22di3", "", "24:di3", "", "write err", "", "", "", "", "Latest Received","", "", "", "", "", "Starter Disable","", "", "", "", "", "", "", "", "", "Solenoid 3 State", "" - debugFieldI4List = bits, U08, [0:7], "Period", "", "", "State", "Idle di4", "Cycle Cnt 1", "", "", "", "", "", "", "", "", "", "", "", "ETB di4", "executor", "", "di4", "di4", "22di4", "", "24:di4", "", "", "", "", "", "", "Init Count", "", "", "", "", "", "S unused" "", "", "", "", "", "", "", "", "", "Solenoid 4 State", "" - debugFieldI5List = bits, U08, [0:7], "", "", "", "", "Idle di5", "Cycle Cnt 2", "", "", "", "", "", "", "", "", "", "di5", "di5", "ETB di5", "max executor", "di5", "di5", "di5", "22di5", "di5", "di5", "di5", "di5", "di5", "di5", "di5", "di5", "di5", "", "di5", "di5", "di5", "di5", "S di5" "", "", "", "", "", "", "", "", "", "Solenoid 5 State", "" + debugFieldI1List = bits, U08, [0:7], "P-Gain", "", "", "P-Gain", "Idle di1", "Channel 1 Fall Counter", "", "", "VVT Sync Counter", "Cycle Counter", "Multispark Count", "", "", "", "", "", "", "ETB P-Gain", "t counter", "", "di1", "di1", "22di1", "", "24:di1", "CJ125: state", "read count","", "", "", "", "SPI Counter", "", "", "", "", "", "Start Count", "", "", "", "", "", "", "deltatime", "", "", "Solenoid 1 State", "" + debugFieldI2List = bits, U08, [0:7], "Offset", "", "", "Offset", "Idle di2", "Channel 2 Fall Counter", "", "", "", "", "", "", "", "", "", "", "", "ETB di2", "invocationcounter", "", "di2", "di2", "22di2", "", "24:di2", "", "write count","", "", "", "", "Latest Transmit","", "", "", "", "", "Starter Enable", "", "", "", "", "", "", "", "", "", "Solenoid 2 State", "" + debugFieldI3List = bits, U08, [0:7], "Reset Cnt", "", "", "Reset Cnt", "Idle di3", "Cycle Index", "", "", "", "", "", "", "", "", "", "", "", "ETB di3", "s counter", "", "di3", "di3", "22di3", "", "24:di3", "", "write err", "", "", "", "", "Latest Received","", "", "", "", "", "Starter Disable","", "", "", "", "", "", "", "", "", "Solenoid 3 State", "" + debugFieldI4List = bits, U08, [0:7], "Period", "", "", "State", "Idle di4", "Cycle Cnt 1", "", "", "", "", "", "", "", "", "", "", "", "ETB di4", "executor", "", "di4", "di4", "22di4", "", "24:di4", "", "", "", "", "", "", "Init Count", "", "", "", "", "", "S unused" "", "", "", "", "", "", "", "", "", "Solenoid 4 State", "" + debugFieldI5List = bits, U08, [0:7], "", "", "", "", "Idle di5", "Cycle Cnt 2", "", "", "", "", "", "", "", "", "", "di5", "di5", "ETB di5", "max executor", "di5", "di5", "di5", "22di5", "di5", "di5", "di5", "di5", "di5", "", "di5", "di5", "di5", "", "di5", "di5", "di5", "di5", "S di5" "", "", "", "", "", "", "", "", "", "Solenoid 5 State", "" [ConstantsExtensions] ; defaultValue is used to provide TunerStudio with a value to use in the case of @@ -859,6 +859,10 @@ enable2ndByteCanID = false gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. upDownLabel = "(RICHER)", "(LEANER)" + table = mapEstimateTableTbl, mapEstimateTableMap, "MAP Estimate", 1 + xBins = mapEstimateRpmBins, RPMValue + yBins = mapEstimateTpsBins, TPSValue + zBins = mapEstimateTable table = injPhaseTableTbl, injPhaseTableMap, "Injection Phase", 1 topicHelp = "fuelHelp" @@ -1360,6 +1364,7 @@ menuDialog = main subMenu = veTableDialog, "VE", 0, {isInjectionEnabled == 1} subMenu = tChargeSettings, "Charge temperature estimation", 0, {isInjectionEnabled == 1} subMenu = baroCorrTbl, "Barometric pressure correction", 0, {isInjectionEnabled == 1 && fuelAlgorithm == LM_SPEED_DENSITY} + subMenu = mapEstimateTableTbl, "MAP estimate table", 0, { enableMapEstimationTableFallback } subMenu = std_separator # Fuel model @@ -2944,7 +2949,8 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00" field = "Boost cut pressure", boostCutPressure dialog = fallbacks, "Fallbacks" - field = "Failed MAP sensor fallback", failedMapFallback + field = "Use MAP estimation table as fallback", enableMapEstimationTableFallback + field = "Failed MAP sensor fallback", failedMapFallback, { !enableMapEstimationTableFallback } dialog = limitsAndFallback, "Limits and fallbacks" panel = limits diff --git a/firmware/util/containers/table_helper.h b/firmware/util/containers/table_helper.h index be20e57173..6c65db35bf 100644 --- a/firmware/util/containers/table_helper.h +++ b/firmware/util/containers/table_helper.h @@ -94,6 +94,7 @@ typedef Map3D boostClosedLoop_Map3D_t; typedef Map3D iacPidMultiplier_t; typedef Map3D gppwm_Map3D_t; +typedef Map3D> mapEstimate_Map3D_t; void setRpmBin(float array[], int size, float idleRpm, float topRpm);