diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 8ffe588860..0b678d1985 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -474,8 +474,6 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ executorStatistics(); #endif /* EFI_PROD_CODE */ - float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE); - // header tsOutputChannels->tsConfigVersion = TS_FILE_VERSION; @@ -524,7 +522,10 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->airFuelRatio = getAfr(PASS_ENGINE_PARAMETER_SIGNATURE); } // offset 24 - tsOutputChannels->engineLoad = engineLoad; + tsOutputChannels->engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE); + + tsOutputChannels->fuelingLoad = getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE); + tsOutputChannels->ignitionLoad = getIgnitionLoad(PASS_ENGINE_PARAMETER_SIGNATURE); // KLUDGE? we always show VBatt because Proteus board has VBatt input sensor hardcoded // offset 28 diff --git a/firmware/controllers/algo/engine_state.h b/firmware/controllers/algo/engine_state.h index 0d3845da56..50361ab441 100644 --- a/firmware/controllers/algo/engine_state.h +++ b/firmware/controllers/algo/engine_state.h @@ -63,6 +63,8 @@ public: int vssEventCounter = 0; + float fuelingLoad = 0; + float ignitionLoad = 0; /** * pre-calculated value from simple fuel lookup diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index 442b3e2b0b..db2f22058b 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -239,10 +239,18 @@ floatms_t getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { // Plop some state for others to read ENGINE(engineState.targetAFR) = targetAfr; ENGINE(engineState.sd.airMassInOneCylinder) = airmass.CylinderAirmass; + ENGINE(engineState.fuelingLoad) = airmass.EngineLoadPercent; + // TODO: independently selectable ignition load mode + ENGINE(engineState.ignitionLoad) = airmass.EngineLoadPercent; baseFuel = getInjectionDurationForAirmass(airmass.CylinderAirmass, targetAfr PASS_ENGINE_PARAMETER_SUFFIX) * 1000; efiAssert(CUSTOM_ERR_ASSERT, !cisnan(baseFuel), "NaN baseFuel", 0); } else { + float tps = Sensor::get(SensorType::Tps1).value_or(0); + ENGINE(engineState.fuelingLoad) = tps; + // TODO: independently selectable ignition load mode + ENGINE(engineState.ignitionLoad) = tps; + baseFuel = engine->engineState.baseTableFuel; efiAssert(CUSTOM_ERR_ASSERT, !cisnan(baseFuel), "NaN bt baseFuel", 0); } diff --git a/firmware/controllers/generated/fsio_enums_generated.def b/firmware/controllers/generated/fsio_enums_generated.def index 972cf4f616..714cb398cd 100644 --- a/firmware/controllers/generated/fsio_enums_generated.def +++ b/firmware/controllers/generated/fsio_enums_generated.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 05 01:09:15 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 05 20:29:44 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer FSIO_SETTING_FANONTEMPERATURE = 1000, diff --git a/firmware/controllers/generated/fsio_getters.def b/firmware/controllers/generated/fsio_getters.def index 23191caa5a..6bbce147da 100644 --- a/firmware/controllers/generated/fsio_getters.def +++ b/firmware/controllers/generated/fsio_getters.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 05 01:09:15 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 05 20:29:44 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer case FSIO_SETTING_FANONTEMPERATURE: diff --git a/firmware/controllers/generated/fsio_names.def b/firmware/controllers/generated/fsio_names.def index d6d6d0d537..36b43e3fd8 100644 --- a/firmware/controllers/generated/fsio_names.def +++ b/firmware/controllers/generated/fsio_names.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 05 01:09:15 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 05 20:29:44 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer static LENameOrdinalPair lefanOnTemperature(FSIO_SETTING_FANONTEMPERATURE, "cfg_fanOnTemperature"); diff --git a/firmware/controllers/generated/fsio_strings.def b/firmware/controllers/generated/fsio_strings.def index eb9e9eb0cb..25e8fdd1fa 100644 --- a/firmware/controllers/generated/fsio_strings.def +++ b/firmware/controllers/generated/fsio_strings.def @@ -1,4 +1,4 @@ -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 05 01:09:15 UTC 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Sun Jul 05 20:29:44 UTC 2020 // by class com.rusefi.output.FileFsioSettingsConsumer case FSIO_SETTING_FANONTEMPERATURE: diff --git a/firmware/controllers/generated/signature_all.h b/firmware/controllers/generated/signature_all.h index 306a3b35a6..ffa89b890d 100644 --- a/firmware/controllers/generated/signature_all.h +++ b/firmware/controllers/generated/signature_all.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD all #define SIGNATURE_DATE 2020.07.05 -#define SIGNATURE_HASH 3057196371 -#define TS_SIGNATURE "rusEFI 2020.07.05.all.3057196371" +#define SIGNATURE_HASH 3237681268 +#define TS_SIGNATURE "rusEFI 2020.07.05.all.3237681268" diff --git a/firmware/controllers/generated/signature_fra.h b/firmware/controllers/generated/signature_fra.h index 1122271f00..70f0bbf3bb 100644 --- a/firmware/controllers/generated/signature_fra.h +++ b/firmware/controllers/generated/signature_fra.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD fra #define SIGNATURE_DATE 2020.07.05 -#define SIGNATURE_HASH 1757311408 -#define TS_SIGNATURE "rusEFI 2020.07.05.fra.1757311408" +#define SIGNATURE_HASH 511472791 +#define TS_SIGNATURE "rusEFI 2020.07.05.fra.511472791" diff --git a/firmware/controllers/generated/signature_kin.h b/firmware/controllers/generated/signature_kin.h index 416783ada5..bd0bc05c30 100644 --- a/firmware/controllers/generated/signature_kin.h +++ b/firmware/controllers/generated/signature_kin.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD kin #define SIGNATURE_DATE 2020.07.05 -#define SIGNATURE_HASH 2064105929 -#define TS_SIGNATURE "rusEFI 2020.07.05.kin.2064105929" +#define SIGNATURE_HASH 231064814 +#define TS_SIGNATURE "rusEFI 2020.07.05.kin.231064814" diff --git a/firmware/controllers/generated/signature_mre.h b/firmware/controllers/generated/signature_mre.h index 4686203dd6..806260ead4 100644 --- a/firmware/controllers/generated/signature_mre.h +++ b/firmware/controllers/generated/signature_mre.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD mre #define SIGNATURE_DATE 2020.07.05 -#define SIGNATURE_HASH 4291283933 -#define TS_SIGNATURE "rusEFI 2020.07.05.mre.4291283933" +#define SIGNATURE_HASH 2298859258 +#define TS_SIGNATURE "rusEFI 2020.07.05.mre.2298859258" diff --git a/firmware/controllers/generated/signature_pro.h b/firmware/controllers/generated/signature_pro.h index cba10e419e..759ab745ca 100644 --- a/firmware/controllers/generated/signature_pro.h +++ b/firmware/controllers/generated/signature_pro.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD pro #define SIGNATURE_DATE 2020.07.05 -#define SIGNATURE_HASH 1000893596 -#define TS_SIGNATURE "rusEFI 2020.07.05.pro.1000893596" +#define SIGNATURE_HASH 1298819515 +#define TS_SIGNATURE "rusEFI 2020.07.05.pro.1298819515" diff --git a/firmware/controllers/generated/signature_pth.h b/firmware/controllers/generated/signature_pth.h index 7ff27eeb10..0ac55fa967 100644 --- a/firmware/controllers/generated/signature_pth.h +++ b/firmware/controllers/generated/signature_pth.h @@ -4,5 +4,5 @@ #define SIGNATURE_BOARD pth #define SIGNATURE_DATE 2020.07.05 -#define SIGNATURE_HASH 1126548951 -#define TS_SIGNATURE "rusEFI 2020.07.05.pth.1126548951" +#define SIGNATURE_HASH 904380656 +#define TS_SIGNATURE "rusEFI 2020.07.05.pth.904380656" diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index de2305add5..38bd003840 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -49,6 +49,14 @@ floatms_t getCrankshaftRevolutionTimeMs(int rpm) { return 360 * getOneDegreeTimeMs(rpm); } +float getFuelingLoad(DECLARE_ENGINE_PARAMETER_SIGNATURE) { + return ENGINE(engineState.fuelingLoad); +} + +float getIgnitionLoad(DECLARE_ENGINE_PARAMETER_SIGNATURE) { + return ENGINE(engineState.ignitionLoad); +} + /** * @brief Returns engine load according to selected engine_load_mode * diff --git a/firmware/controllers/math/engine_math.h b/firmware/controllers/math/engine_math.h index 79334e1929..5ec14659db 100644 --- a/firmware/controllers/math/engine_math.h +++ b/firmware/controllers/math/engine_math.h @@ -42,6 +42,9 @@ void setFlatInjectorLag(float value DECLARE_CONFIG_PARAMETER_SUFFIX); floatms_t getCrankshaftRevolutionTimeMs(int rpm); floatms_t getEngineCycleDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); +float getFuelingLoad(DECLARE_ENGINE_PARAMETER_SIGNATURE); +float getIgnitionLoad(DECLARE_ENGINE_PARAMETER_SIGNATURE); +// getEngineLoadT is deprecated - please use one of the above functions, getFuelingLoad or getIgnitionMode float getEngineLoadT(DECLARE_ENGINE_PARAMETER_SIGNATURE); floatms_t getSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index eb36b57316..bf042489a0 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -1491,6 +1491,7 @@ end_struct #define GAUGE_NAME_FUEL_PID_CORR "fuel: Short-term fuel trim" #define GAUGE_NAME_FUEL_WALL_AMOUNT "fuel: wall amount" #define GAUGE_NAME_FUEL_WALL_CORRECTION "fuel: wall corr ms" +#define GAUGE_NAME_FUEL_LOAD "fuel: load" #define GAUGE_NAME_FUEL_INJ_DUTY "fuel: injector duty cycle" #define GAUGE_NAME_TCHARGE "fuel: SD tCharge" @@ -1498,6 +1499,10 @@ end_struct #define GAUGE_NAME_AFR "Air/Fuel Ratio" #define GAUGE_NAME_IAC "Idle Air Valve" +#define GAUGE_NAME_DWELL_DUTY "dwell: coil duty cycle" +#define GAUGE_COIL_DWELL_TIME "dwell: coil charge time" +#define GAUGE_NAME_IGNITION_LOAD "ign: load" + #define GAUGE_NAME_DEBUG_F1 "debug f1" #define GAUGE_NAME_DEBUG_F2 "debug f2: iTerm" #define GAUGE_NAME_DEBUG_F3 "debug f3: prevError" @@ -1642,10 +1647,6 @@ end_struct #define ET_BMW_M73_PROTEUS 63 #define ET_CITROEN_TU3JP 65 -#define GAUGE_NAME_DWELL_DUTY "dwell: coil duty cycle" - -#define GAUGE_COIL_DWELL_TIME "dwell: coil charge time" - ! some board files override this value using prepend file #define ts_show_hip9011 true #define ts_show_main_relay true diff --git a/firmware/tunerstudio/cache.zip b/firmware/tunerstudio/cache.zip index 1100a32851..3b5e9020be 100644 Binary files a/firmware/tunerstudio/cache.zip and b/firmware/tunerstudio/cache.zip differ diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 4d2d5916b3..a78ecc471d 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -984,6 +984,7 @@ gaugeCategory = Ignition ignadvGauge = ignitionAdvance, "Ignition timing", "degrees", -100, 100, -999, -999, 999, 999, 1, 1 dwellGauge = sparkDwellValue, "Dwell", "mSec", 0, 10, 0.5, 1.0, 6.0, 8.0, 1, 1 coilDutyCycleGauge = coilDutyCycle, @@GAUGE_NAME_DWELL_DUTY@@, "perc", -11, 11, 1.0, 1.2, 100, 100, 3, 1 + ignitionLoadGauge = ignitionLoad, @@GAUGE_NAME_IGNITION_LOAD@@, "%", 0, 300, 0, 0, 300, 300, 1, 1 gaugeCategory = Acceleration Enrichment engineLoadDeltaGauge = engineLoadDelta,"AE: load change","value", 0, 120, 10, 10, 100, 100, 1, 1 @@ -1008,6 +1009,7 @@ gaugeCategory = Fueling fuelRunningGauge = fuelRunning, @@GAUGE_NAME_FUEL_RUNNING@@, "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 baseFuelGauge = baseFuel, @@GAUGE_NAME_FUEL_BASE@@, "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 fuelPidCorrectionGauge = fuelPidCorrection, @@GAUGE_NAME_FUEL_PID_CORR@@, "%", -10, 10, -8, -5, 5, 8, 3, 1 + fuelingLoadGauge = fuelingLoad, @@GAUGE_NAME_FUEL_LOAD@@, "%", 0, 300, 0, 0, 300, 300, 1, 1 gaugeCategory = Throttle Body (incl. ETB) pedalPositionGauge = throttlePedalPosition, @@GAUGE_NAME_THROTTLE_PEDAL@@, "%", 0, 120, 0, 0, 100, 100, 1, 1 @@ -1257,14 +1259,14 @@ menuDialog = main subMenu = std_separator # Targets & closed loop - subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled == 1 && (fuelAlgorithm == LM_SPEED_DENSITY || fuelAlgorithm == LM_REAL_MAF)} + subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled == 1} subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled == 1} subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled == 1} subMenu = std_separator # Fuel table/VE subMenu = fuelTableDialog, "Fuel table", 0, {isInjectionEnabled == 1 && fuelAlgorithm != LM_SPEED_DENSITY && fuelAlgorithm != LM_REAL_MAF} - subMenu = veTableDialog, "VE", 0, {isInjectionEnabled == 1 && (fuelAlgorithm == LM_SPEED_DENSITY || fuelAlgorithm == LM_REAL_MAF)} + subMenu = veTableDialog, "VE", 0, {isInjectionEnabled == 1} subMenu = injPhaseTableTbl, "Injection phase", 0, {isInjectionEnabled == 1} subMenu = std_separator diff --git a/java_console/models/src/main/java/com/rusefi/tracing/JsonOutput.java b/java_console/models/src/main/java/com/rusefi/tracing/JsonOutput.java index 2dd9a3f4f2..7042f61533 100644 --- a/java_console/models/src/main/java/com/rusefi/tracing/JsonOutput.java +++ b/java_console/models/src/main/java/com/rusefi/tracing/JsonOutput.java @@ -36,7 +36,7 @@ public class JsonOutput { "{\"name\":\"process_name\",\"ph\":\"M\",\"pid\":58,\"tid\":0,\"args\":{\"name\":\"DMA2s2\"}}," + "{\"name\":\"process_name\",\"ph\":\"M\",\"pid\":59,\"tid\":0,\"args\":{\"name\":\"DMA2s3\"}}," + "{\"name\":\"process_name\",\"ph\":\"M\",\"pid\":60,\"tid\":0,\"args\":{\"name\":\"DMA2s4\"}}," + - "{\"name\":\"process_name\",\"ph\":\"M\",\"pid\":67,\"tid\":0,\"args\":{\"name\":\"USB\"}}," + "{\"name\":\"process_name\",\"ph\":\"M\",\"pid\":67,\"tid\":0,\"args\":{\"name\":\"USB\"}}" ; private static final String EOL = "\r\n";