diff --git a/firmware/config/boards/kinetis/config/controllers/algo/engine_configuration_generated_structures.h b/firmware/config/boards/kinetis/config/controllers/algo/engine_configuration_generated_structures.h index d2c8843766..3e8181ccb2 100644 --- a/firmware/config/boards/kinetis/config/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/config/boards/kinetis/config/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Fri May 29 21:22:44 EDT 2020 +// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Mon Jun 01 07:18:46 EDT 2020 // by class com.rusefi.output.CHeaderConsumer // begin #ifndef CONFIG_BOARDS_KINETIS_CONFIG_CONTROLLERS_ALGO_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H @@ -1273,7 +1273,7 @@ struct engine_configuration_s { /** * offset 696 */ - float fuelClosedLoopAfrLowThreshold; + uint32_t unused696; /** * offset 700 */ @@ -2731,15 +2731,7 @@ struct engine_configuration_s { /** * offset 2508 */ - int16_t fuelClosedLoopCltThreshold; - /** - * offset 2510 - */ - int16_t fuelClosedLoopTpsThreshold; - /** - * offset 2512 - */ - int16_t fuelClosedLoopRpmThreshold; + uint8_t unused2508[6]; /** * offset 2514 */ @@ -2747,11 +2739,7 @@ struct engine_configuration_s { /** * offset 2516 */ - pid_s fuelClosedLoopPid; - /** - * offset 2536 - */ - float fuelClosedLoopAfrHighThreshold; + uint8_t unused2516[24]; /** * per-cylinder timing correction * offset 2540 @@ -3521,4 +3509,4 @@ typedef struct persistent_config_s persistent_config_s; #endif // end -// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Fri May 29 21:22:44 EDT 2020 +// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Mon Jun 01 07:18:46 EDT 2020 diff --git a/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h b/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h index 6a68d791a7..396ffff672 100644 --- a/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h +++ b/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h @@ -509,20 +509,7 @@ #define FUEL_LOAD_COUNT 16 #define FUEL_RPM_COUNT 16 #define fuelAlgorithm_offset 420 -#define fuelClosedLoopAfrHighThreshold_offset 2536 -#define fuelClosedLoopAfrLowThreshold_offset 696 -#define fuelClosedLoopCltThreshold_offset 2508 #define fuelClosedLoopCorrectionEnabled_offset 1464 -#define fuelClosedLoopPid_dFactor_offset 2524 -#define fuelClosedLoopPid_iFactor_offset 2520 -#define fuelClosedLoopPid_maxValue_offset 2534 -#define fuelClosedLoopPid_minValue_offset 2532 -#define fuelClosedLoopPid_offset 2516 -#define fuelClosedLoopPid_offset_offset 2528 -#define fuelClosedLoopPid_periodMs_offset 2530 -#define fuelClosedLoopPid_pFactor_offset 2516 -#define fuelClosedLoopRpmThreshold_offset 2512 -#define fuelClosedLoopTpsThreshold_offset 2510 #define fuelLevelEmptyTankVoltage_offset 684 #define fuelLevelFullTankVoltage_offset 688 #define fuelLevelSensor_offset 514 @@ -568,7 +555,7 @@ #define GAUGE_NAME_FUEL_IAT_CORR "fuel: IAT correction" #define GAUGE_NAME_FUEL_INJ_DUTY "fuel: injector duty cycle" #define GAUGE_NAME_FUEL_LAST_INJECTION "fuel: Last injection" -#define GAUGE_NAME_FUEL_PID_CORR "fuel: Short-term closed loop correction" +#define GAUGE_NAME_FUEL_PID_CORR "fuel: Short-term fuel trim" #define GAUGE_NAME_FUEL_RUNNING "fuel: running" #define GAUGE_NAME_FUEL_TPS_EXTRA "fuel: TPS acceleration extra fuel ms" #define GAUGE_NAME_FUEL_TPS_ROC "fuel: TPS change" @@ -1018,8 +1005,10 @@ #define PROTOCOL_ENGINE_SNIFFER "wave_chart" #define PROTOCOL_ES_DOWN "d" #define PROTOCOL_ES_UP "u" +#define PROTOCOL_HELLO_PREFIX "***" #define PROTOCOL_HIP_NAME "HIP" #define PROTOCOL_INJ1_SHORT_NAME "i1" +#define PROTOCOL_MSG "msg" #define PROTOCOL_OUTPIN "outpin" #define PROTOCOL_TACH_NAME "tach" #define PROTOCOL_TEST_RESPONSE_TAG "ts_p_alive" @@ -1321,7 +1310,10 @@ #define unused1059_offset 3964 #define unused1476b20_offset 1476 #define unused2432_offset 2432 +#define unused2508_offset 2508 +#define unused2516_offset 2516 #define unused6312_offset 6312 +#define unused696_offset 696 #define unused711_offset 711 #define unused806_offset 806 #define unused_1484_bit_24_offset 1476 diff --git a/firmware/console/binary/tunerstudio_outputs.h b/firmware/console/binary/tunerstudio_outputs.h index 9f9a515a81..1bc4dbc202 100644 --- a/firmware/console/binary/tunerstudio_outputs.h +++ b/firmware/console/binary/tunerstudio_outputs.h @@ -127,7 +127,7 @@ typedef struct { scaled_percent iatCorrection; // 64 scaled_percent cltCorrection; // 66 scaled_percent baroCorrection; // 68 - scaled_ms fuelPidCorrection; // 70 + scaled_percent shortTermFuelTrim; // 70 // Wall model AE scaled_ms wallFuelAmount; // 72 diff --git a/firmware/console/binary_log/binary_logging.cpp b/firmware/console/binary_log/binary_logging.cpp index 658325666c..fd909cbb7b 100644 --- a/firmware/console/binary_log/binary_logging.cpp +++ b/firmware/console/binary_log/binary_logging.cpp @@ -27,7 +27,7 @@ static const LogField fields[] = { {tsOutputChannels.veValue, GAUGE_NAME_FUEL_VE, "%", 1}, {tsOutputChannels.tCharge, "tCharge", "C", 1}, {tsOutputChannels.injectorLagMs, GAUGE_NAME_INJECTOR_LAG, "ms", 3}, - {tsOutputChannels.fuelPidCorrection, GAUGE_NAME_FUEL_PID_CORR, "ms", 3}, + {tsOutputChannels.shortTermFuelTrim, GAUGE_NAME_FUEL_PID_CORR, "%", 3}, {tsOutputChannels.wallFuelCorrection, GAUGE_NAME_FUEL_WALL_CORRECTION, "ms", 3}, {tsOutputChannels.tpsAccelFuel, GAUGE_NAME_FUEL_TPS_EXTRA, "ms", 3}, {tsOutputChannels.ignitionAdvance, GAUGE_NAME_TIMING_ADVANCE, "deg", 1}, diff --git a/firmware/console/eficonsole.cpp b/firmware/console/eficonsole.cpp index 298fa2db0f..4f1d101a82 100644 --- a/firmware/console/eficonsole.cpp +++ b/firmware/console/eficonsole.cpp @@ -46,11 +46,11 @@ static void sayNothing(void) { } static void sayHello(void) { - scheduleMsg(&logger, "*** rusEFI LLC (c) 2012-2020. All rights reserved."); - scheduleMsg(&logger, "rusEFI v%d@%s", getRusEfiVersion(), VCS_VERSION); - scheduleMsg(&logger, "*** Chibios Kernel: %s", CH_KERNEL_VERSION); - scheduleMsg(&logger, "*** Compiled: " __DATE__ " - " __TIME__ ""); - scheduleMsg(&logger, "COMPILER=%s", __VERSION__); + scheduleMsg(&logger, PROTOCOL_HELLO_PREFIX " rusEFI LLC (c) 2012-2020. All rights reserved."); + scheduleMsg(&logger, PROTOCOL_HELLO_PREFIX " rusEFI v%d@%s", getRusEfiVersion(), VCS_VERSION); + scheduleMsg(&logger, PROTOCOL_HELLO_PREFIX " Chibios Kernel: %s", CH_KERNEL_VERSION); + scheduleMsg(&logger, PROTOCOL_HELLO_PREFIX " Compiled: " __DATE__ " - " __TIME__ ""); + scheduleMsg(&logger, PROTOCOL_HELLO_PREFIX " COMPILER=%s", __VERSION__); #if defined(STM32F4) || defined(STM32F7) uint32_t *uid = ((uint32_t *)UID_BASE); diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 728e31835d..2ed994334b 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -582,7 +582,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ // 120 tsOutputChannels->firmwareVersion = getRusEfiVersion(); // 268 - tsOutputChannels->fuelPidCorrection = ENGINE(engineState.running.pidCorrection); + tsOutputChannels->shortTermFuelTrim = 100.0f * (ENGINE(engineState.running.pidCorrection) - 1.0f); // 276 tsOutputChannels->accelerationX = engine->sensors.accelerometer.x; // 278 diff --git a/firmware/controllers/algo/engine2.cpp b/firmware/controllers/algo/engine2.cpp index 8db251a9f1..1b2bd890b6 100644 --- a/firmware/controllers/algo/engine2.cpp +++ b/firmware/controllers/algo/engine2.cpp @@ -16,6 +16,7 @@ #include "advance_map.h" #include "aux_valves.h" #include "perf_trace.h" +#include "closed_loop_fuel.h" #include "sensor.h" #if EFI_PROD_CODE @@ -146,6 +147,8 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // todo: move this into slow callback, no reason for CLT corr to be here running.coolantTemperatureCoefficient = getCltFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); + running.pidCorrection = fuelClosedLoopCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); + // update fuel consumption states fuelConsumption.update(nowNt PASS_ENGINE_PARAMETER_SUFFIX); diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index 4c13d6d1a0..d73a3c48f0 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -125,7 +125,7 @@ floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX) { efiAssert(CUSTOM_ERR_ASSERT, !cisnan(cltCorrection), "NaN cltCorrection", 0); efiAssert(CUSTOM_ERR_ASSERT, !cisnan(postCrankingFuelCorrection), "NaN postCrankingFuelCorrection", 0); - floatms_t runningFuel = baseFuel * iatCorrection * cltCorrection * postCrankingFuelCorrection + ENGINE(engineState.running.pidCorrection); + floatms_t runningFuel = baseFuel * iatCorrection * cltCorrection * postCrankingFuelCorrection * ENGINE(engineState.running.pidCorrection); efiAssert(CUSTOM_ERR_ASSERT, !cisnan(runningFuel), "NaN runningFuel", 0); DISPLAY_TEXT(eol); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index cefc9c4545..8f3e82ba16 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -717,6 +717,6 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20200525; + return 20200531; } #endif /* EFI_UNIT_TEST */ diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index 35f7ecffba..1457bd835d 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -58,9 +58,6 @@ static const char *prevOutputName = nullptr; static InjectionEvent primeInjEvent; static Logging *logger; -#if ! EFI_UNIT_TEST -static Pid fuelPid(&persistentState.persistentConfiguration.engineConfiguration.fuelClosedLoopPid); -#endif // todo: figure out if this even helps? //#if defined __GNUC__ @@ -284,30 +281,6 @@ void handleFuelInjectionEvent(int injEventIndex, InjectionEvent *event, #endif /* EFI_DEFAILED_LOGGING */ } -static void fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { -#if ! EFI_UNIT_TEST - if (GET_RPM_VALUE < CONFIG(fuelClosedLoopRpmThreshold) || - Sensor::get(SensorType::Clt).value_or(0) < CONFIG(fuelClosedLoopCltThreshold) || - Sensor::get(SensorType::Tps1).value_or(100) > CONFIG(fuelClosedLoopTpsThreshold) || - ENGINE(sensors.currentAfr) < CONFIG(fuelClosedLoopAfrLowThreshold) || - ENGINE(sensors.currentAfr) > engineConfiguration->fuelClosedLoopAfrHighThreshold) { - engine->engineState.running.pidCorrection = 0; - fuelPid.reset(); - return; - } - - engine->engineState.running.pidCorrection = fuelPid.getOutput(ENGINE(engineState.targetAFR), ENGINE(sensors.currentAfr), NOT_TIME_BASED_PID); - if (engineConfiguration->debugMode == DBG_FUEL_PID_CORRECTION) { -#if EFI_TUNER_STUDIO - tsOutputChannels.debugFloatField1 = engine->engineState.running.pidCorrection; - fuelPid.postState(&tsOutputChannels); -#endif /* EFI_TUNER_STUDIO */ - } - -#endif -} - - static ALWAYS_INLINE void handleFuel(const bool limitedFuel, uint32_t trgEventIndex, int rpm, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { ScopePerf perf(PE::HandleFuel); @@ -442,10 +415,6 @@ static void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEvent // we need this to apply new 'triggerIndexByAngle' values engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); } - - if (CONFIG(fuelClosedLoopCorrectionEnabled)) { - fuelClosedLoopCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); - } } efiAssertVoid(CUSTOM_IGN_MATH_STATE, !CONFIG(useOnlyRisingEdgeForTrigger) || CONFIG(ignMathCalculateAtIndex) % 2 == 0, "invalid ignMathCalculateAtIndex"); diff --git a/firmware/controllers/generated/engine_configuration_generated_structures.h b/firmware/controllers/generated/engine_configuration_generated_structures.h index 9d60992377..77523706d6 100644 --- a/firmware/controllers/generated/engine_configuration_generated_structures.h +++ b/firmware/controllers/generated/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Fri May 29 21:22:15 EDT 2020 +// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:30 EDT 2020 // by class com.rusefi.output.CHeaderConsumer // begin #ifndef CONTROLLERS_GENERATED_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H @@ -1273,7 +1273,7 @@ struct engine_configuration_s { /** * offset 696 */ - float fuelClosedLoopAfrLowThreshold; + uint32_t unused696; /** * offset 700 */ @@ -2731,15 +2731,7 @@ struct engine_configuration_s { /** * offset 2508 */ - int16_t fuelClosedLoopCltThreshold; - /** - * offset 2510 - */ - int16_t fuelClosedLoopTpsThreshold; - /** - * offset 2512 - */ - int16_t fuelClosedLoopRpmThreshold; + uint8_t unused2508[6]; /** * offset 2514 */ @@ -2747,11 +2739,7 @@ struct engine_configuration_s { /** * offset 2516 */ - pid_s fuelClosedLoopPid; - /** - * offset 2536 - */ - float fuelClosedLoopAfrHighThreshold; + uint8_t unused2516[24]; /** * per-cylinder timing correction * offset 2540 @@ -3521,4 +3509,4 @@ typedef struct persistent_config_s persistent_config_s; #endif // end -// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Fri May 29 21:22:15 EDT 2020 +// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:30 EDT 2020 diff --git a/firmware/controllers/generated/fsio_enums_generated.def b/firmware/controllers/generated/fsio_enums_generated.def index 5f931992fa..31c59c7065 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 integration\rusefi_config.txt Fri Jan 31 14:07:20 EST 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:30 EDT 2020 // by class com.rusefi.output.FileFsioSettingsConsumer FSIO_SETTING_FANONTEMPERATURE = 1000, @@ -12,17 +12,15 @@ FSIO_SETTING_IDLERPMPID_OFFSET = 1008, FSIO_SETTING_IDLERPMPID_MINVALUE = 1009, FSIO_SETTING_STARTUPFUELPUMPDURATION = 1010, - FSIO_SETTING_FUELCLOSEDLOOPPID_OFFSET = 1011, - FSIO_SETTING_FUELCLOSEDLOOPPID_MINVALUE = 1012, - FSIO_SETTING_AUXPID1_OFFSET = 1013, - FSIO_SETTING_AUXPID1_MINVALUE = 1014, - FSIO_SETTING_AUXPID2_OFFSET = 1015, - FSIO_SETTING_AUXPID2_MINVALUE = 1016, - FSIO_SETTING_AUXPID3_OFFSET = 1017, - FSIO_SETTING_AUXPID3_MINVALUE = 1018, - FSIO_SETTING_AUXPID4_OFFSET = 1019, - FSIO_SETTING_AUXPID4_MINVALUE = 1020, - FSIO_SETTING_IDLETIMINGPID_OFFSET = 1021, - FSIO_SETTING_IDLETIMINGPID_MINVALUE = 1022, - FSIO_SETTING_IDLERPMPID2_OFFSET = 1023, - FSIO_SETTING_IDLERPMPID2_MINVALUE = 1024, + FSIO_SETTING_AUXPID1_OFFSET = 1011, + FSIO_SETTING_AUXPID1_MINVALUE = 1012, + FSIO_SETTING_AUXPID2_OFFSET = 1013, + FSIO_SETTING_AUXPID2_MINVALUE = 1014, + FSIO_SETTING_AUXPID3_OFFSET = 1015, + FSIO_SETTING_AUXPID3_MINVALUE = 1016, + FSIO_SETTING_AUXPID4_OFFSET = 1017, + FSIO_SETTING_AUXPID4_MINVALUE = 1018, + FSIO_SETTING_IDLETIMINGPID_OFFSET = 1019, + FSIO_SETTING_IDLETIMINGPID_MINVALUE = 1020, + FSIO_SETTING_IDLERPMPID2_OFFSET = 1021, + FSIO_SETTING_IDLERPMPID2_MINVALUE = 1022, diff --git a/firmware/controllers/generated/fsio_getters.def b/firmware/controllers/generated/fsio_getters.def index 9765334266..b2ae42ea9a 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 integration\rusefi_config.txt Fri Jan 31 14:07:20 EST 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:30 EDT 2020 // by class com.rusefi.output.FileFsioSettingsConsumer case FSIO_SETTING_FANONTEMPERATURE: @@ -23,10 +23,6 @@ return engineConfiguration->idleRpmPid.minValue; case FSIO_SETTING_STARTUPFUELPUMPDURATION: return engineConfiguration->startUpFuelPumpDuration; - case FSIO_SETTING_FUELCLOSEDLOOPPID_OFFSET: - return engineConfiguration->fuelClosedLoopPid.offset; - case FSIO_SETTING_FUELCLOSEDLOOPPID_MINVALUE: - return engineConfiguration->fuelClosedLoopPid.minValue; case FSIO_SETTING_AUXPID1_OFFSET: return engineConfiguration->auxPid[0].offset; case FSIO_SETTING_AUXPID1_MINVALUE: diff --git a/firmware/controllers/generated/fsio_names.def b/firmware/controllers/generated/fsio_names.def index 12861a1198..1dda3f5685 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 integration\rusefi_config.txt Fri Jan 31 14:07:20 EST 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:30 EDT 2020 // by class com.rusefi.output.FileFsioSettingsConsumer static LENameOrdinalPair lefanOnTemperature(FSIO_SETTING_FANONTEMPERATURE, "cfg_fanOnTemperature"); @@ -12,8 +12,6 @@ static LENameOrdinalPair leetb_minValue(FSIO_SETTING_ETB_MINVALUE, "cfg_etb_minV static LENameOrdinalPair leidleRpmPid_offset(FSIO_SETTING_IDLERPMPID_OFFSET, "cfg_idleRpmPid_offset"); static LENameOrdinalPair leidleRpmPid_minValue(FSIO_SETTING_IDLERPMPID_MINVALUE, "cfg_idleRpmPid_minValue"); static LENameOrdinalPair lestartUpFuelPumpDuration(FSIO_SETTING_STARTUPFUELPUMPDURATION, "cfg_startUpFuelPumpDuration"); -static LENameOrdinalPair lefuelClosedLoopPid_offset(FSIO_SETTING_FUELCLOSEDLOOPPID_OFFSET, "cfg_fuelClosedLoopPid_offset"); -static LENameOrdinalPair lefuelClosedLoopPid_minValue(FSIO_SETTING_FUELCLOSEDLOOPPID_MINVALUE, "cfg_fuelClosedLoopPid_minValue"); static LENameOrdinalPair leauxPid1_offset(FSIO_SETTING_AUXPID1_OFFSET, "cfg_auxPid1_offset"); static LENameOrdinalPair leauxPid1_minValue(FSIO_SETTING_AUXPID1_MINVALUE, "cfg_auxPid1_minValue"); static LENameOrdinalPair leauxPid2_offset(FSIO_SETTING_AUXPID2_OFFSET, "cfg_auxPid2_offset"); diff --git a/firmware/controllers/generated/fsio_strings.def b/firmware/controllers/generated/fsio_strings.def index 06f63b5e4a..4e7d9e064f 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 integration\rusefi_config.txt Fri Jan 31 14:07:20 EST 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:30 EDT 2020 // by class com.rusefi.output.FileFsioSettingsConsumer case FSIO_SETTING_FANONTEMPERATURE: @@ -23,10 +23,6 @@ return "cfg_idleRpmPid_minValue"; case FSIO_SETTING_STARTUPFUELPUMPDURATION: return "cfg_startUpFuelPumpDuration"; - case FSIO_SETTING_FUELCLOSEDLOOPPID_OFFSET: - return "cfg_fuelClosedLoopPid_offset"; - case FSIO_SETTING_FUELCLOSEDLOOPPID_MINVALUE: - return "cfg_fuelClosedLoopPid_minValue"; case FSIO_SETTING_AUXPID1_OFFSET: return "cfg_auxPid1_offset"; case FSIO_SETTING_AUXPID1_MINVALUE: diff --git a/firmware/controllers/generated/rusefi_generated.h b/firmware/controllers/generated/rusefi_generated.h index dcc9ee5e0d..0e534e687c 100644 --- a/firmware/controllers/generated/rusefi_generated.h +++ b/firmware/controllers/generated/rusefi_generated.h @@ -509,20 +509,7 @@ #define FUEL_LOAD_COUNT 16 #define FUEL_RPM_COUNT 16 #define fuelAlgorithm_offset 420 -#define fuelClosedLoopAfrHighThreshold_offset 2536 -#define fuelClosedLoopAfrLowThreshold_offset 696 -#define fuelClosedLoopCltThreshold_offset 2508 #define fuelClosedLoopCorrectionEnabled_offset 1464 -#define fuelClosedLoopPid_dFactor_offset 2524 -#define fuelClosedLoopPid_iFactor_offset 2520 -#define fuelClosedLoopPid_maxValue_offset 2534 -#define fuelClosedLoopPid_minValue_offset 2532 -#define fuelClosedLoopPid_offset 2516 -#define fuelClosedLoopPid_offset_offset 2528 -#define fuelClosedLoopPid_periodMs_offset 2530 -#define fuelClosedLoopPid_pFactor_offset 2516 -#define fuelClosedLoopRpmThreshold_offset 2512 -#define fuelClosedLoopTpsThreshold_offset 2510 #define fuelLevelEmptyTankVoltage_offset 684 #define fuelLevelFullTankVoltage_offset 688 #define fuelLevelSensor_offset 514 @@ -568,7 +555,7 @@ #define GAUGE_NAME_FUEL_IAT_CORR "fuel: IAT correction" #define GAUGE_NAME_FUEL_INJ_DUTY "fuel: injector duty cycle" #define GAUGE_NAME_FUEL_LAST_INJECTION "fuel: Last injection" -#define GAUGE_NAME_FUEL_PID_CORR "fuel: Short-term closed loop correction" +#define GAUGE_NAME_FUEL_PID_CORR "fuel: Short-term fuel trim" #define GAUGE_NAME_FUEL_RUNNING "fuel: running" #define GAUGE_NAME_FUEL_TPS_EXTRA "fuel: TPS acceleration extra fuel ms" #define GAUGE_NAME_FUEL_TPS_ROC "fuel: TPS change" @@ -1018,8 +1005,10 @@ #define PROTOCOL_ENGINE_SNIFFER "wave_chart" #define PROTOCOL_ES_DOWN "d" #define PROTOCOL_ES_UP "u" +#define PROTOCOL_HELLO_PREFIX "***" #define PROTOCOL_HIP_NAME "HIP" #define PROTOCOL_INJ1_SHORT_NAME "i1" +#define PROTOCOL_MSG "msg" #define PROTOCOL_OUTPIN "outpin" #define PROTOCOL_TACH_NAME "tach" #define PROTOCOL_TEST_RESPONSE_TAG "ts_p_alive" @@ -1321,7 +1310,10 @@ #define unused1059_offset 3964 #define unused1476b20_offset 1476 #define unused2432_offset 2432 +#define unused2508_offset 2508 +#define unused2516_offset 2516 #define unused6312_offset 6312 +#define unused696_offset 696 #define unused711_offset 711 #define unused806_offset 806 #define unused_1484_bit_24_offset 1476 diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 29e07692d8..5b667436db 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -654,7 +654,7 @@ custom adc_channel_mode_e 4 bits, U32, @OFFSET@, [0:7], "Off", "Slow", "Fas float fuelLevelFullTankVoltage;;"V", 1, 0, 0,10, 2 ego_sensor_e afr_type;AFR, WBO, EGO - whatever you like to call it; - float fuelClosedLoopAfrLowThreshold;;"ratio", 1, 0, 0, 100, 1 + uint32_t unused696; brain_input_pin_e[TRIGGER_INPUT_PIN_COUNT iterate] triggerInputPins; pin_output_mode_e hip9011CsPinMode; @@ -1147,13 +1147,10 @@ tle8888_mode_e tle8888mode; float postCrankingDurationSec;+Time over which to taper out after start enrichment;"seconds", 1, 0, 0, 100, 2 ThermistorConf auxTempSensor1;todo: finish implementation #332 ThermistorConf auxTempSensor2;todo: finish implementation #332 - int16_t fuelClosedLoopCltThreshold;;"C", 1, 0, 0, 100, 0 - int16_t fuelClosedLoopTpsThreshold;;"%", 1, 0, 0, 100, 0 - int16_t fuelClosedLoopRpmThreshold;;"rpm", 1, 0, 0, 5000, 0 + uint8_t[6] unused2508; int16_t etbFreq;;"Hz", 1, 0, 0, 30000, 0 - pid_s fuelClosedLoopPid; - float fuelClosedLoopAfrHighThreshold;;"ratio", 1, 0, 0, 100, 1 - + uint8_t[24] unused2516; + custom cfg_float_t_1f 4 scalar, F32, @OFFSET@, "Val", 1, 0, -20000000, 20000000, 1 cfg_float_t_1f[IGNITION_PIN_COUNT iterate] timing_offset_cylinder;per-cylinder timing correction @@ -1484,7 +1481,7 @@ end_struct #define GAUGE_NAME_FUEL_RUNNING "fuel: running" #define GAUGE_NAME_FUEL_LAST_INJECTION "fuel: Last injection" #define GAUGE_NAME_FUEL_BASE "fuel: base" -#define GAUGE_NAME_FUEL_PID_CORR "fuel: Short-term closed loop correction" +#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" @@ -1534,6 +1531,9 @@ end_struct #define CMD_DISABLE "disable" #define CMD_TRIGGER_HW_INPUT "trigger_hw_input" +#define PROTOCOL_MSG "msg" +#define PROTOCOL_HELLO_PREFIX "***" + #define PROTOCOL_OUTPIN "outpin" #define PROTOCOL_ANALOG_CHART "analog_chart" #define PROTOCOL_ENGINE_SNIFFER "wave_chart" diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 782bc3e51d..a433551f94 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Fri May 29 21:22:15 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:30 EDT 2020 pageSize = 20000 page = 1 @@ -341,7 +341,7 @@ page = 1 fuelLevelEmptyTankVoltage = scalar, F32, 684, "V", 1, 0, 0,10, 2 fuelLevelFullTankVoltage = scalar, F32, 688, "V", 1, 0, 0,10, 2 afr_type = bits, S32, 692, [0:7], "BPSX", "Innovate", "14Point7", "Narrow", "PLX", "Custom" - fuelClosedLoopAfrLowThreshold = scalar, F32, 696, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused696 offset 696 triggerInputPins1 = bits, U08, 700, [0:7], "NONE", "INVALID", "INVALID", "PA1", "PA2", "PA3", "INVALID", "PA5", "PA6", "PA7", "PA8", "PA9", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PA15", "INVALID", "INVALID", "INVALID", "PB3", "PB4", "PB5", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "PC7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "PE6", "INVALID", "INVALID", "PE9", "INVALID", "PE11", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" triggerInputPins2 = bits, U08, 701, [0:7], "NONE", "INVALID", "INVALID", "PA1", "PA2", "PA3", "INVALID", "PA5", "PA6", "PA7", "PA8", "PA9", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PA15", "INVALID", "INVALID", "INVALID", "PB3", "PB4", "PB5", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "PC7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "PE6", "INVALID", "INVALID", "PE9", "INVALID", "PE11", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" triggerInputPins3 = bits, U08, 702, [0:7], "NONE", "INVALID", "INVALID", "PA1", "PA2", "PA3", "INVALID", "PA5", "PA6", "PA7", "PA8", "PA9", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PA15", "INVALID", "INVALID", "INVALID", "PB3", "PB4", "PB5", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "PC7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "PE6", "INVALID", "INVALID", "PE9", "INVALID", "PE11", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" @@ -895,18 +895,9 @@ page = 1 auxTempSensor2_bias_resistor = scalar, F32, 2500, "Ohm", 1, 0, 0, 200000, 1 auxTempSensor2_adcChannel = bits, U08, 2504, [0:7] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "Disabled", "PB12", "PB13", "PC14", "PC15", "PC16", "PC17", "PD3", "PD4", "PE2", "PE6", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" ;no TS info - skipping auxTempSensor2_alignmentFill_at_29 offset 2505 - fuelClosedLoopCltThreshold = scalar, S16, 2508, "C", 1, 0, 0, 100, 0 - fuelClosedLoopTpsThreshold = scalar, S16, 2510, "%", 1, 0, 0, 100, 0 - fuelClosedLoopRpmThreshold = scalar, S16, 2512, "rpm", 1, 0, 0, 5000, 0 +;no TS info - skipping unused2508 offset 2508 etbFreq = scalar, S16, 2514, "Hz", 1, 0, 0, 30000, 0 - fuelClosedLoopPid_pFactor = scalar, F32, 2516, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_iFactor = scalar, F32, 2520, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_dFactor = scalar, F32, 2524, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_offset = scalar, S16, 2528, "", 1, 0, -1000, 1000, 0 - fuelClosedLoopPid_periodMs = scalar, S16, 2530, "ms", 1, 0, 0, 3000, 0 - fuelClosedLoopPid_minValue = scalar, S16, 2532, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopPid_maxValue = scalar, S16, 2534, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopAfrHighThreshold = scalar, F32, 2536, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused2516 offset 2516 timing_offset_cylinder1 = scalar, F32, 2540, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder2 = scalar, F32, 2544, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder3 = scalar, F32, 2548, "Val", 1, 0, -20000000, 20000000, 1 @@ -1545,7 +1536,7 @@ page = 1 iatCorrection = scalar, S16, 64, "%",{1/100}, 0 cltCorrection = scalar, S16, 66, "%",{1/100}, 0 baroCorrection = scalar, S16, 68, "%",{1/100}, 0 - fuelPidCorrection=scalar, S16, 70, "ms",{1/300}, 0 + fuelPidCorrection=scalar, S16, 70, "%",{1/100}, 0 ; Wall model AE wallFuelAmount = scalar, U16, 72, "ms",{1/300}, 0 @@ -2280,7 +2271,7 @@ gaugeCategory = Fueling injectorLagMsGauge = injectorLagMs, "fuel: injector lag", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 fuelRunningGauge = fuelRunning, "fuel: running", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 baseFuelGauge = baseFuel, "fuel: base", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 - fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term closed loop correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1 + fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term fuel trim", "%", -10, 10, -8, -5, 5, 8, 3, 1 gaugeCategory = Throttle Body (incl. ETB) pedalPositionGauge = throttlePedalPosition, "Throttle pedal position", "%", 0, 120, 0, 0, 100, 100, 1, 1 @@ -2413,7 +2404,7 @@ gaugeCategory = Sensors - Raw entry = fuelRunning, "fuel: running", float, "%.3f" entry = actualLastInjection, "fuel: Last injection", float, "%.3f" entry = baseFuel, "fuel: base", float, "%.2f" - entry = fuelPidCorrection,"fuel: Short-term closed loop correction", float, "%.2f" + entry = fuelPidCorrection,"fuel: Short-term fuel trim", float, "%.2f" entry = veValue, "fuel: VE", float, "%.3f" entry = injectorDutyCycle,"fuel: injector duty cycle",float,"%.3f" entry = coilDutyCycle, "dwell: coil duty cycle", float,"%.3f" @@ -2552,7 +2543,7 @@ menuDialog = main # Targets & closed loop subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled == 1 && (fuelAlgorithm == LM_SPEED_DENSITY || fuelAlgorithm == LM_REAL_MAF)} - subMenu = fuelClosedLoopDialog, "Closed loop correction", 0, {isInjectionEnabled == 1} + subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled == 1} subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled == 1} subMenu = std_separator @@ -2720,12 +2711,12 @@ menuDialog = main subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" subMenu = pedalToTpsTbl, "Electronic Pedal Map" subMenu = std_separator - subMenu = smLaunchControl, "Launch Control" - subMenu = std_separator - subMenu = smRollingLaunch, "Rolling Launch" - subMenu = std_separator - subMenu = antiLag, "Antilag Setup" - subMenu = std_separator +# subMenu = smLaunchControl, "Launch Control" +# subMenu = std_separator +# subMenu = smRollingLaunch, "Rolling Launch" +# subMenu = std_separator +# subMenu = antiLag, "Antilag Setup" +# subMenu = std_separator menu = "Help" @@ -3723,23 +3714,46 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "SPI3sck mode", spi3SckMode, {is_enabled_spi_3 == 1} field = "LIS302DLCsPin", LIS302DLCsPin - dialog = fuelClosedLoopDialog, "Fuel short-term closed-loop correction" - field = "#This is just the cherry on the cake once you have good VE table" - field = "Enabled", fuelClosedLoopCorrectionEnabled - field = "!No correction below these value" - field = "CLT - low threshod", fuelClosedLoopCltThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "RPM - low threshod", fuelClosedLoopRpmThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - low threshod", fuelClosedLoopAfrLowThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!No correction above these value" - field = "TPS - high threshod", fuelClosedLoopTpsThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - high threshod", fuelClosedLoopAfrHighThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!PID settings" - field = "P factor", fuelClosedLoopPid_pFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "I factor", fuelClosedLoopPid_iFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "D factor", fuelClosedLoopPid_dFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "min", fuelClosedLoopPid_minValue, {fuelClosedLoopCorrectionEnabled == 1} - field = "max", fuelClosedLoopPid_maxValue, {fuelClosedLoopCorrectionEnabled == 1} + dialog = stftPartitioning, "Region Configuration" + field = "Idle region RPM", stft_maxIdleRegionRpm + field = "Overrun region load", stft_maxOverrunLoad + field = "Power region load", stft_minPowerLoad + dialog = stftPartitionSettingsMain, "Main Region", xAxis + field = "Time Const", stft_cellCfgs4_timeConstant + field = "Max add", stft_cellCfgs4_maxAdd + field = "Max remove", stft_cellCfgs4_maxRemove + + dialog = stftPartitionSettingsIdle, "Idle Region", xAxis + field = "Time Const", stft_cellCfgs1_timeConstant + field = "Max add", stft_cellCfgs1_maxAdd + field = "Max remove", stft_cellCfgs1_maxRemove + + dialog = stftPartitionSettingsPower, "Power Region", xAxis + field = "Time Const", stft_cellCfgs3_timeConstant + field = "Max add", stft_cellCfgs3_maxAdd + field = "Max remove", stft_cellCfgs3_maxRemove + + dialog = stftPartitionSettingsOverrun, "Overrun Region", xAxis + field = "Time Const", stft_cellCfgs2_timeConstant + field = "Max add", stft_cellCfgs2_maxAdd + field = "Max remove", stft_cellCfgs2_maxRemove + + dialog = fuelClosedLoopDialog, "Short-term fuel trim" + field = "Enabled", fuelClosedLoopCorrectionEnabled + + field = "Startup delay" stft_startupDelay, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum CLT for correction", stft_minClt, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum AFR for correction", stft_minAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Maximum AFR for correction", stft_maxAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Adjustment deadband", stft_deadband, {fuelClosedLoopCorrectionEnabled == 1} + field = "Ignore error magnitude", stftIgnoreErrorMagnitude, {fuelClosedLoopCorrectionEnabled == 1} + + panel = stftPartitioning, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsMain, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsIdle, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsPower, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsOverrun, {fuelClosedLoopCorrectionEnabled == 1} dialog = auxPidDialog, "Aux PID" field = "Enabled", activateAuxPid1 diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index b052f3a617..f6198fec85 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -264,7 +264,7 @@ enable2ndByteCanID = false iatCorrection = scalar, S16, 64, "%",{1/@@PACK_MULT_PERCENT@@}, 0 cltCorrection = scalar, S16, 66, "%",{1/@@PACK_MULT_PERCENT@@}, 0 baroCorrection = scalar, S16, 68, "%",{1/@@PACK_MULT_PERCENT@@}, 0 - fuelPidCorrection=scalar, S16, 70, "ms",{1/@@PACK_MULT_MS@@}, 0 + fuelPidCorrection=scalar, S16, 70, "%",{1/@@PACK_MULT_PERCENT@@}, 0 ; Wall model AE wallFuelAmount = scalar, U16, 72, "ms",{1/@@PACK_MULT_MS@@}, 0 @@ -999,7 +999,7 @@ gaugeCategory = Fueling injectorLagMsGauge = injectorLagMs, @@GAUGE_NAME_INJECTOR_LAG@@, "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 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@@, "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1 + fuelPidCorrectionGauge = fuelPidCorrection, @@GAUGE_NAME_FUEL_PID_CORR@@, "%", -10, 10, -8, -5, 5, 8, 3, 1 gaugeCategory = Throttle Body (incl. ETB) pedalPositionGauge = throttlePedalPosition, @@GAUGE_NAME_THROTTLE_PEDAL@@, "%", 0, 120, 0, 0, 100, 100, 1, 1 @@ -1271,7 +1271,7 @@ menuDialog = main # Targets & closed loop subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled == 1 && (fuelAlgorithm == LM_SPEED_DENSITY || fuelAlgorithm == LM_REAL_MAF)} - subMenu = fuelClosedLoopDialog, "Closed loop correction", 0, {isInjectionEnabled == 1} + subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled == 1} subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled == 1} subMenu = std_separator @@ -1439,12 +1439,12 @@ menuDialog = main subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" @@if_ts_show_etb subMenu = pedalToTpsTbl, "Electronic Pedal Map" @@if_ts_show_etb subMenu = std_separator - subMenu = smLaunchControl, "Launch Control" - subMenu = std_separator - subMenu = smRollingLaunch, "Rolling Launch" - subMenu = std_separator - subMenu = antiLag, "Antilag Setup" - subMenu = std_separator +# subMenu = smLaunchControl, "Launch Control" +# subMenu = std_separator +# subMenu = smRollingLaunch, "Rolling Launch" +# subMenu = std_separator +# subMenu = antiLag, "Antilag Setup" +# subMenu = std_separator menu = "Help" @@ -2433,23 +2433,46 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "SPI3sck mode", spi3SckMode, {is_enabled_spi_3 == 1} field = "LIS302DLCsPin", LIS302DLCsPin - dialog = fuelClosedLoopDialog, "Fuel short-term closed-loop correction" - field = "#This is just the cherry on the cake once you have good VE table" - field = "Enabled", fuelClosedLoopCorrectionEnabled - field = "!No correction below these value" - field = "CLT - low threshod", fuelClosedLoopCltThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "RPM - low threshod", fuelClosedLoopRpmThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - low threshod", fuelClosedLoopAfrLowThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!No correction above these value" - field = "TPS - high threshod", fuelClosedLoopTpsThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - high threshod", fuelClosedLoopAfrHighThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!PID settings" - field = "P factor", fuelClosedLoopPid_pFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "I factor", fuelClosedLoopPid_iFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "D factor", fuelClosedLoopPid_dFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "min", fuelClosedLoopPid_minValue, {fuelClosedLoopCorrectionEnabled == 1} - field = "max", fuelClosedLoopPid_maxValue, {fuelClosedLoopCorrectionEnabled == 1} + dialog = stftPartitioning, "Region Configuration" + field = "Idle region RPM", stft_maxIdleRegionRpm + field = "Overrun region load", stft_maxOverrunLoad + field = "Power region load", stft_minPowerLoad + dialog = stftPartitionSettingsMain, "Main Region", xAxis + field = "Time Const", stft_cellCfgs4_timeConstant + field = "Max add", stft_cellCfgs4_maxAdd + field = "Max remove", stft_cellCfgs4_maxRemove + + dialog = stftPartitionSettingsIdle, "Idle Region", xAxis + field = "Time Const", stft_cellCfgs1_timeConstant + field = "Max add", stft_cellCfgs1_maxAdd + field = "Max remove", stft_cellCfgs1_maxRemove + + dialog = stftPartitionSettingsPower, "Power Region", xAxis + field = "Time Const", stft_cellCfgs3_timeConstant + field = "Max add", stft_cellCfgs3_maxAdd + field = "Max remove", stft_cellCfgs3_maxRemove + + dialog = stftPartitionSettingsOverrun, "Overrun Region", xAxis + field = "Time Const", stft_cellCfgs2_timeConstant + field = "Max add", stft_cellCfgs2_maxAdd + field = "Max remove", stft_cellCfgs2_maxRemove + + dialog = fuelClosedLoopDialog, "Short-term fuel trim" + field = "Enabled", fuelClosedLoopCorrectionEnabled + + field = "Startup delay" stft_startupDelay, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum CLT for correction", stft_minClt, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum AFR for correction", stft_minAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Maximum AFR for correction", stft_maxAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Adjustment deadband", stft_deadband, {fuelClosedLoopCorrectionEnabled == 1} + field = "Ignore error magnitude", stftIgnoreErrorMagnitude, {fuelClosedLoopCorrectionEnabled == 1} + + panel = stftPartitioning, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsMain, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsIdle, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsPower, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsOverrun, {fuelClosedLoopCorrectionEnabled == 1} dialog = auxPidDialog, "Aux PID" field = "Enabled", activateAuxPid1 diff --git a/firmware/tunerstudio/rusefi_frankenso.ini b/firmware/tunerstudio/rusefi_frankenso.ini index bd7982a13b..ae56a10343 100644 --- a/firmware/tunerstudio/rusefi_frankenso.ini +++ b/firmware/tunerstudio/rusefi_frankenso.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Fri May 29 21:22:29 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:39 EDT 2020 pageSize = 20000 page = 1 @@ -341,7 +341,7 @@ page = 1 fuelLevelEmptyTankVoltage = scalar, F32, 684, "V", 1, 0, 0,10, 2 fuelLevelFullTankVoltage = scalar, F32, 688, "V", 1, 0, 0,10, 2 afr_type = bits, S32, 692, [0:7], "BPSX", "Innovate", "14Point7", "Narrow", "PLX", "Custom" - fuelClosedLoopAfrLowThreshold = scalar, F32, 696, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused696 offset 696 triggerInputPins1 = bits, U08, 700, [0:7], "NONE", "INVALID", "INVALID", "PA1", "PA2", "PA3", "INVALID", "PA5", "PA6", "PA7", "PA8", "PA9", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PA15", "INVALID", "INVALID", "INVALID", "PB3", "PB4", "PB5", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "PC7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "PE6", "INVALID", "INVALID", "PE9", "INVALID", "PE11", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" triggerInputPins2 = bits, U08, 701, [0:7], "NONE", "INVALID", "INVALID", "PA1", "PA2", "PA3", "INVALID", "PA5", "PA6", "PA7", "PA8", "PA9", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PA15", "INVALID", "INVALID", "INVALID", "PB3", "PB4", "PB5", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "PC7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "PE6", "INVALID", "INVALID", "PE9", "INVALID", "PE11", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" triggerInputPins3 = bits, U08, 702, [0:7], "NONE", "INVALID", "INVALID", "PA1", "PA2", "PA3", "INVALID", "PA5", "PA6", "PA7", "PA8", "PA9", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PA15", "INVALID", "INVALID", "INVALID", "PB3", "PB4", "PB5", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "PC7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "PE6", "INVALID", "INVALID", "PE9", "INVALID", "PE11", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" @@ -895,18 +895,9 @@ page = 1 auxTempSensor2_bias_resistor = scalar, F32, 2500, "Ohm", 1, 0, 0, 200000, 1 auxTempSensor2_adcChannel = bits, U08, 2504, [0:7] "Analog 3O","Analog 3L","Analog 3M","Analog 3J","Analog 3I","INVALID","Analog 3H","Analog 3G","INVALID","INVALID","INVALID","Analog 3P","Analog 3Q","Analog 3N","Analog VBatt","Analog 3E","NONE" ;no TS info - skipping auxTempSensor2_alignmentFill_at_29 offset 2505 - fuelClosedLoopCltThreshold = scalar, S16, 2508, "C", 1, 0, 0, 100, 0 - fuelClosedLoopTpsThreshold = scalar, S16, 2510, "%", 1, 0, 0, 100, 0 - fuelClosedLoopRpmThreshold = scalar, S16, 2512, "rpm", 1, 0, 0, 5000, 0 +;no TS info - skipping unused2508 offset 2508 etbFreq = scalar, S16, 2514, "Hz", 1, 0, 0, 30000, 0 - fuelClosedLoopPid_pFactor = scalar, F32, 2516, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_iFactor = scalar, F32, 2520, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_dFactor = scalar, F32, 2524, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_offset = scalar, S16, 2528, "", 1, 0, -1000, 1000, 0 - fuelClosedLoopPid_periodMs = scalar, S16, 2530, "ms", 1, 0, 0, 3000, 0 - fuelClosedLoopPid_minValue = scalar, S16, 2532, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopPid_maxValue = scalar, S16, 2534, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopAfrHighThreshold = scalar, F32, 2536, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused2516 offset 2516 timing_offset_cylinder1 = scalar, F32, 2540, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder2 = scalar, F32, 2544, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder3 = scalar, F32, 2548, "Val", 1, 0, -20000000, 20000000, 1 @@ -1545,7 +1536,7 @@ page = 1 iatCorrection = scalar, S16, 64, "%",{1/100}, 0 cltCorrection = scalar, S16, 66, "%",{1/100}, 0 baroCorrection = scalar, S16, 68, "%",{1/100}, 0 - fuelPidCorrection=scalar, S16, 70, "ms",{1/300}, 0 + fuelPidCorrection=scalar, S16, 70, "%",{1/100}, 0 ; Wall model AE wallFuelAmount = scalar, U16, 72, "ms",{1/300}, 0 @@ -2280,7 +2271,7 @@ gaugeCategory = Fueling injectorLagMsGauge = injectorLagMs, "fuel: injector lag", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 fuelRunningGauge = fuelRunning, "fuel: running", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 baseFuelGauge = baseFuel, "fuel: base", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 - fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term closed loop correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1 + fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term fuel trim", "%", -10, 10, -8, -5, 5, 8, 3, 1 gaugeCategory = Throttle Body (incl. ETB) pedalPositionGauge = throttlePedalPosition, "Throttle pedal position", "%", 0, 120, 0, 0, 100, 100, 1, 1 @@ -2413,7 +2404,7 @@ gaugeCategory = Sensors - Raw entry = fuelRunning, "fuel: running", float, "%.3f" entry = actualLastInjection, "fuel: Last injection", float, "%.3f" entry = baseFuel, "fuel: base", float, "%.2f" - entry = fuelPidCorrection,"fuel: Short-term closed loop correction", float, "%.2f" + entry = fuelPidCorrection,"fuel: Short-term fuel trim", float, "%.2f" entry = veValue, "fuel: VE", float, "%.3f" entry = injectorDutyCycle,"fuel: injector duty cycle",float,"%.3f" entry = coilDutyCycle, "dwell: coil duty cycle", float,"%.3f" @@ -2552,7 +2543,7 @@ menuDialog = main # Targets & closed loop subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled == 1 && (fuelAlgorithm == LM_SPEED_DENSITY || fuelAlgorithm == LM_REAL_MAF)} - subMenu = fuelClosedLoopDialog, "Closed loop correction", 0, {isInjectionEnabled == 1} + subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled == 1} subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled == 1} subMenu = std_separator @@ -2720,12 +2711,12 @@ menuDialog = main subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" subMenu = pedalToTpsTbl, "Electronic Pedal Map" subMenu = std_separator - subMenu = smLaunchControl, "Launch Control" - subMenu = std_separator - subMenu = smRollingLaunch, "Rolling Launch" - subMenu = std_separator - subMenu = antiLag, "Antilag Setup" - subMenu = std_separator +# subMenu = smLaunchControl, "Launch Control" +# subMenu = std_separator +# subMenu = smRollingLaunch, "Rolling Launch" +# subMenu = std_separator +# subMenu = antiLag, "Antilag Setup" +# subMenu = std_separator menu = "Help" @@ -3723,23 +3714,46 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "SPI3sck mode", spi3SckMode, {is_enabled_spi_3 == 1} field = "LIS302DLCsPin", LIS302DLCsPin - dialog = fuelClosedLoopDialog, "Fuel short-term closed-loop correction" - field = "#This is just the cherry on the cake once you have good VE table" - field = "Enabled", fuelClosedLoopCorrectionEnabled - field = "!No correction below these value" - field = "CLT - low threshod", fuelClosedLoopCltThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "RPM - low threshod", fuelClosedLoopRpmThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - low threshod", fuelClosedLoopAfrLowThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!No correction above these value" - field = "TPS - high threshod", fuelClosedLoopTpsThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - high threshod", fuelClosedLoopAfrHighThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!PID settings" - field = "P factor", fuelClosedLoopPid_pFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "I factor", fuelClosedLoopPid_iFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "D factor", fuelClosedLoopPid_dFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "min", fuelClosedLoopPid_minValue, {fuelClosedLoopCorrectionEnabled == 1} - field = "max", fuelClosedLoopPid_maxValue, {fuelClosedLoopCorrectionEnabled == 1} + dialog = stftPartitioning, "Region Configuration" + field = "Idle region RPM", stft_maxIdleRegionRpm + field = "Overrun region load", stft_maxOverrunLoad + field = "Power region load", stft_minPowerLoad + dialog = stftPartitionSettingsMain, "Main Region", xAxis + field = "Time Const", stft_cellCfgs4_timeConstant + field = "Max add", stft_cellCfgs4_maxAdd + field = "Max remove", stft_cellCfgs4_maxRemove + + dialog = stftPartitionSettingsIdle, "Idle Region", xAxis + field = "Time Const", stft_cellCfgs1_timeConstant + field = "Max add", stft_cellCfgs1_maxAdd + field = "Max remove", stft_cellCfgs1_maxRemove + + dialog = stftPartitionSettingsPower, "Power Region", xAxis + field = "Time Const", stft_cellCfgs3_timeConstant + field = "Max add", stft_cellCfgs3_maxAdd + field = "Max remove", stft_cellCfgs3_maxRemove + + dialog = stftPartitionSettingsOverrun, "Overrun Region", xAxis + field = "Time Const", stft_cellCfgs2_timeConstant + field = "Max add", stft_cellCfgs2_maxAdd + field = "Max remove", stft_cellCfgs2_maxRemove + + dialog = fuelClosedLoopDialog, "Short-term fuel trim" + field = "Enabled", fuelClosedLoopCorrectionEnabled + + field = "Startup delay" stft_startupDelay, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum CLT for correction", stft_minClt, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum AFR for correction", stft_minAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Maximum AFR for correction", stft_maxAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Adjustment deadband", stft_deadband, {fuelClosedLoopCorrectionEnabled == 1} + field = "Ignore error magnitude", stftIgnoreErrorMagnitude, {fuelClosedLoopCorrectionEnabled == 1} + + panel = stftPartitioning, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsMain, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsIdle, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsPower, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsOverrun, {fuelClosedLoopCorrectionEnabled == 1} dialog = auxPidDialog, "Aux PID" field = "Enabled", activateAuxPid1 diff --git a/firmware/tunerstudio/rusefi_kinetis.ini b/firmware/tunerstudio/rusefi_kinetis.ini index 7926a6ff76..e80c3bea1f 100644 --- a/firmware/tunerstudio/rusefi_kinetis.ini +++ b/firmware/tunerstudio/rusefi_kinetis.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Fri May 29 21:22:44 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Mon Jun 01 07:18:46 EDT 2020 pageSize = 20000 page = 1 @@ -341,7 +341,7 @@ page = 1 fuelLevelEmptyTankVoltage = scalar, F32, 684, "V", 1, 0, 0,10, 2 fuelLevelFullTankVoltage = scalar, F32, 688, "V", 1, 0, 0,10, 2 afr_type = bits, S32, 692, [0:7], "BPSX", "Innovate", "14Point7", "Narrow", "PLX", "Custom" - fuelClosedLoopAfrLowThreshold = scalar, F32, 696, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused696 offset 696 triggerInputPins1 = bits, U08, 700, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "N/A", "N/A", "PA10", "PA11", "PA12", "PA13", "N/A", "N/A", "N/A", "N/A", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "N/A", "N/A", "N/A", "N/A", "PB12", "PB13", "N/A", "N/A", "N/A", "N/A", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "N/A", "N/A", "N/A", "N/A", "PC14", "PC15", "PC16", "PC17", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "PD15", "PD16", "N/A", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A" triggerInputPins2 = bits, U08, 701, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "N/A", "N/A", "PA10", "PA11", "PA12", "PA13", "N/A", "N/A", "N/A", "N/A", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "N/A", "N/A", "N/A", "N/A", "PB12", "PB13", "N/A", "N/A", "N/A", "N/A", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "N/A", "N/A", "N/A", "N/A", "PC14", "PC15", "PC16", "PC17", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "PD15", "PD16", "N/A", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A" triggerInputPins3 = bits, U08, 702, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "N/A", "N/A", "PA10", "PA11", "PA12", "PA13", "N/A", "N/A", "N/A", "N/A", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "N/A", "N/A", "N/A", "N/A", "PB12", "PB13", "N/A", "N/A", "N/A", "N/A", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "N/A", "N/A", "N/A", "N/A", "PC14", "PC15", "PC16", "PC17", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "PD15", "PD16", "N/A", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A" @@ -895,18 +895,9 @@ page = 1 auxTempSensor2_bias_resistor = scalar, F32, 2500, "Ohm", 1, 0, 0, 200000, 1 auxTempSensor2_adcChannel = bits, U08, 2504, [0:7] "PA2", "PA3", "INVALID", "PD3", "INVALID", "INVALID", "INVALID", "PB12", "PB13", "INVALID", "PE2", "INVALID", "PC14", "PC15", "PC16", "PC17", "Disabled", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" ;no TS info - skipping auxTempSensor2_alignmentFill_at_29 offset 2505 - fuelClosedLoopCltThreshold = scalar, S16, 2508, "C", 1, 0, 0, 100, 0 - fuelClosedLoopTpsThreshold = scalar, S16, 2510, "%", 1, 0, 0, 100, 0 - fuelClosedLoopRpmThreshold = scalar, S16, 2512, "rpm", 1, 0, 0, 5000, 0 +;no TS info - skipping unused2508 offset 2508 etbFreq = scalar, S16, 2514, "Hz", 1, 0, 0, 30000, 0 - fuelClosedLoopPid_pFactor = scalar, F32, 2516, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_iFactor = scalar, F32, 2520, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_dFactor = scalar, F32, 2524, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_offset = scalar, S16, 2528, "", 1, 0, -1000, 1000, 0 - fuelClosedLoopPid_periodMs = scalar, S16, 2530, "ms", 1, 0, 0, 3000, 0 - fuelClosedLoopPid_minValue = scalar, S16, 2532, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopPid_maxValue = scalar, S16, 2534, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopAfrHighThreshold = scalar, F32, 2536, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused2516 offset 2516 timing_offset_cylinder1 = scalar, F32, 2540, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder2 = scalar, F32, 2544, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder3 = scalar, F32, 2548, "Val", 1, 0, -20000000, 20000000, 1 @@ -1545,7 +1536,7 @@ page = 1 iatCorrection = scalar, S16, 64, "%",{1/100}, 0 cltCorrection = scalar, S16, 66, "%",{1/100}, 0 baroCorrection = scalar, S16, 68, "%",{1/100}, 0 - fuelPidCorrection=scalar, S16, 70, "ms",{1/300}, 0 + fuelPidCorrection=scalar, S16, 70, "%",{1/100}, 0 ; Wall model AE wallFuelAmount = scalar, U16, 72, "ms",{1/300}, 0 @@ -2280,7 +2271,7 @@ gaugeCategory = Fueling injectorLagMsGauge = injectorLagMs, "fuel: injector lag", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 fuelRunningGauge = fuelRunning, "fuel: running", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 baseFuelGauge = baseFuel, "fuel: base", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 - fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term closed loop correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1 + fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term fuel trim", "%", -10, 10, -8, -5, 5, 8, 3, 1 gaugeCategory = Throttle Body (incl. ETB) pedalPositionGauge = throttlePedalPosition, "Throttle pedal position", "%", 0, 120, 0, 0, 100, 100, 1, 1 @@ -2413,7 +2404,7 @@ gaugeCategory = Sensors - Raw entry = fuelRunning, "fuel: running", float, "%.3f" entry = actualLastInjection, "fuel: Last injection", float, "%.3f" entry = baseFuel, "fuel: base", float, "%.2f" - entry = fuelPidCorrection,"fuel: Short-term closed loop correction", float, "%.2f" + entry = fuelPidCorrection,"fuel: Short-term fuel trim", float, "%.2f" entry = veValue, "fuel: VE", float, "%.3f" entry = injectorDutyCycle,"fuel: injector duty cycle",float,"%.3f" entry = coilDutyCycle, "dwell: coil duty cycle", float,"%.3f" @@ -2552,7 +2543,7 @@ menuDialog = main # Targets & closed loop subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled == 1 && (fuelAlgorithm == LM_SPEED_DENSITY || fuelAlgorithm == LM_REAL_MAF)} - subMenu = fuelClosedLoopDialog, "Closed loop correction", 0, {isInjectionEnabled == 1} + subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled == 1} subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled == 1} subMenu = std_separator @@ -2720,12 +2711,12 @@ menuDialog = main subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" subMenu = pedalToTpsTbl, "Electronic Pedal Map" subMenu = std_separator - subMenu = smLaunchControl, "Launch Control" - subMenu = std_separator - subMenu = smRollingLaunch, "Rolling Launch" - subMenu = std_separator - subMenu = antiLag, "Antilag Setup" - subMenu = std_separator +# subMenu = smLaunchControl, "Launch Control" +# subMenu = std_separator +# subMenu = smRollingLaunch, "Rolling Launch" +# subMenu = std_separator +# subMenu = antiLag, "Antilag Setup" +# subMenu = std_separator menu = "Help" @@ -3724,23 +3715,46 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "SPI3sck mode", spi3SckMode, {is_enabled_spi_3 == 1} field = "LIS302DLCsPin", LIS302DLCsPin - dialog = fuelClosedLoopDialog, "Fuel short-term closed-loop correction" - field = "#This is just the cherry on the cake once you have good VE table" - field = "Enabled", fuelClosedLoopCorrectionEnabled - field = "!No correction below these value" - field = "CLT - low threshod", fuelClosedLoopCltThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "RPM - low threshod", fuelClosedLoopRpmThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - low threshod", fuelClosedLoopAfrLowThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!No correction above these value" - field = "TPS - high threshod", fuelClosedLoopTpsThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - high threshod", fuelClosedLoopAfrHighThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!PID settings" - field = "P factor", fuelClosedLoopPid_pFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "I factor", fuelClosedLoopPid_iFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "D factor", fuelClosedLoopPid_dFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "min", fuelClosedLoopPid_minValue, {fuelClosedLoopCorrectionEnabled == 1} - field = "max", fuelClosedLoopPid_maxValue, {fuelClosedLoopCorrectionEnabled == 1} + dialog = stftPartitioning, "Region Configuration" + field = "Idle region RPM", stft_maxIdleRegionRpm + field = "Overrun region load", stft_maxOverrunLoad + field = "Power region load", stft_minPowerLoad + dialog = stftPartitionSettingsMain, "Main Region", xAxis + field = "Time Const", stft_cellCfgs4_timeConstant + field = "Max add", stft_cellCfgs4_maxAdd + field = "Max remove", stft_cellCfgs4_maxRemove + + dialog = stftPartitionSettingsIdle, "Idle Region", xAxis + field = "Time Const", stft_cellCfgs1_timeConstant + field = "Max add", stft_cellCfgs1_maxAdd + field = "Max remove", stft_cellCfgs1_maxRemove + + dialog = stftPartitionSettingsPower, "Power Region", xAxis + field = "Time Const", stft_cellCfgs3_timeConstant + field = "Max add", stft_cellCfgs3_maxAdd + field = "Max remove", stft_cellCfgs3_maxRemove + + dialog = stftPartitionSettingsOverrun, "Overrun Region", xAxis + field = "Time Const", stft_cellCfgs2_timeConstant + field = "Max add", stft_cellCfgs2_maxAdd + field = "Max remove", stft_cellCfgs2_maxRemove + + dialog = fuelClosedLoopDialog, "Short-term fuel trim" + field = "Enabled", fuelClosedLoopCorrectionEnabled + + field = "Startup delay" stft_startupDelay, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum CLT for correction", stft_minClt, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum AFR for correction", stft_minAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Maximum AFR for correction", stft_maxAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Adjustment deadband", stft_deadband, {fuelClosedLoopCorrectionEnabled == 1} + field = "Ignore error magnitude", stftIgnoreErrorMagnitude, {fuelClosedLoopCorrectionEnabled == 1} + + panel = stftPartitioning, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsMain, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsIdle, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsPower, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsOverrun, {fuelClosedLoopCorrectionEnabled == 1} dialog = auxPidDialog, "Aux PID" field = "Enabled", activateAuxPid1 diff --git a/firmware/tunerstudio/rusefi_microrusefi.ini b/firmware/tunerstudio/rusefi_microrusefi.ini index bff50c73d7..fccf0ddfdf 100644 --- a/firmware/tunerstudio/rusefi_microrusefi.ini +++ b/firmware/tunerstudio/rusefi_microrusefi.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Fri May 29 21:22:26 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:37 EDT 2020 pageSize = 20000 page = 1 @@ -341,7 +341,7 @@ page = 1 fuelLevelEmptyTankVoltage = scalar, F32, 684, "V", 1, 0, 0,10, 2 fuelLevelFullTankVoltage = scalar, F32, 688, "V", 1, 0, 0,10, 2 afr_type = bits, S32, 692, [0:7], "BPSX", "Innovate", "14Point7", "Narrow", "PLX", "Custom" - fuelClosedLoopAfrLowThreshold = scalar, F32, 696, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused696 offset 696 triggerInputPins1 = bits, U08, 700, [0:7], "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","25 - Hall Cam","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","45 - VR/Hall Crank","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" triggerInputPins2 = bits, U08, 701, [0:7], "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","25 - Hall Cam","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","45 - VR/Hall Crank","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" triggerInputPins3 = bits, U08, 702, [0:7], "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","25 - Hall Cam","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","45 - VR/Hall Crank","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" @@ -895,18 +895,9 @@ page = 1 auxTempSensor2_bias_resistor = scalar, F32, 2500, "Ohm", 1, 0, 0, 200000, 1 auxTempSensor2_adcChannel = bits, U08, 2504, [0:7] "18 - AN temp 1","23 - AN temp 2","24 - AN temp 3","22 - AN temp 4","28 - AN volt 10","INVALID","26 - AN volt 2","31 - AN volt 3","36 - AN volt 8","40 - AN volt 9","27 - AN volt 1","Battery Sense","19 - AN volt 4","20 - AN volt 5","32 - AN volt 6","30 - AN volt 7","NONE" ;no TS info - skipping auxTempSensor2_alignmentFill_at_29 offset 2505 - fuelClosedLoopCltThreshold = scalar, S16, 2508, "C", 1, 0, 0, 100, 0 - fuelClosedLoopTpsThreshold = scalar, S16, 2510, "%", 1, 0, 0, 100, 0 - fuelClosedLoopRpmThreshold = scalar, S16, 2512, "rpm", 1, 0, 0, 5000, 0 +;no TS info - skipping unused2508 offset 2508 etbFreq = scalar, S16, 2514, "Hz", 1, 0, 0, 30000, 0 - fuelClosedLoopPid_pFactor = scalar, F32, 2516, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_iFactor = scalar, F32, 2520, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_dFactor = scalar, F32, 2524, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_offset = scalar, S16, 2528, "", 1, 0, -1000, 1000, 0 - fuelClosedLoopPid_periodMs = scalar, S16, 2530, "ms", 1, 0, 0, 3000, 0 - fuelClosedLoopPid_minValue = scalar, S16, 2532, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopPid_maxValue = scalar, S16, 2534, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopAfrHighThreshold = scalar, F32, 2536, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused2516 offset 2516 timing_offset_cylinder1 = scalar, F32, 2540, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder2 = scalar, F32, 2544, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder3 = scalar, F32, 2548, "Val", 1, 0, -20000000, 20000000, 1 @@ -1545,7 +1536,7 @@ page = 1 iatCorrection = scalar, S16, 64, "%",{1/100}, 0 cltCorrection = scalar, S16, 66, "%",{1/100}, 0 baroCorrection = scalar, S16, 68, "%",{1/100}, 0 - fuelPidCorrection=scalar, S16, 70, "ms",{1/300}, 0 + fuelPidCorrection=scalar, S16, 70, "%",{1/100}, 0 ; Wall model AE wallFuelAmount = scalar, U16, 72, "ms",{1/300}, 0 @@ -2280,7 +2271,7 @@ gaugeCategory = Fueling injectorLagMsGauge = injectorLagMs, "fuel: injector lag", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 fuelRunningGauge = fuelRunning, "fuel: running", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 baseFuelGauge = baseFuel, "fuel: base", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 - fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term closed loop correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1 + fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term fuel trim", "%", -10, 10, -8, -5, 5, 8, 3, 1 gaugeCategory = Throttle Body (incl. ETB) pedalPositionGauge = throttlePedalPosition, "Throttle pedal position", "%", 0, 120, 0, 0, 100, 100, 1, 1 @@ -2413,7 +2404,7 @@ gaugeCategory = Sensors - Raw entry = fuelRunning, "fuel: running", float, "%.3f" entry = actualLastInjection, "fuel: Last injection", float, "%.3f" entry = baseFuel, "fuel: base", float, "%.2f" - entry = fuelPidCorrection,"fuel: Short-term closed loop correction", float, "%.2f" + entry = fuelPidCorrection,"fuel: Short-term fuel trim", float, "%.2f" entry = veValue, "fuel: VE", float, "%.3f" entry = injectorDutyCycle,"fuel: injector duty cycle",float,"%.3f" entry = coilDutyCycle, "dwell: coil duty cycle", float,"%.3f" @@ -2552,7 +2543,7 @@ menuDialog = main # Targets & closed loop subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled == 1 && (fuelAlgorithm == LM_SPEED_DENSITY || fuelAlgorithm == LM_REAL_MAF)} - subMenu = fuelClosedLoopDialog, "Closed loop correction", 0, {isInjectionEnabled == 1} + subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled == 1} subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled == 1} subMenu = std_separator @@ -2712,12 +2703,12 @@ menuDialog = main subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" subMenu = pedalToTpsTbl, "Electronic Pedal Map" subMenu = std_separator - subMenu = smLaunchControl, "Launch Control" - subMenu = std_separator - subMenu = smRollingLaunch, "Rolling Launch" - subMenu = std_separator - subMenu = antiLag, "Antilag Setup" - subMenu = std_separator +# subMenu = smLaunchControl, "Launch Control" +# subMenu = std_separator +# subMenu = smRollingLaunch, "Rolling Launch" +# subMenu = std_separator +# subMenu = antiLag, "Antilag Setup" +# subMenu = std_separator menu = "Help" @@ -3702,23 +3693,46 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "SPI3sck mode", spi3SckMode, {is_enabled_spi_3 == 1} field = "LIS302DLCsPin", LIS302DLCsPin - dialog = fuelClosedLoopDialog, "Fuel short-term closed-loop correction" - field = "#This is just the cherry on the cake once you have good VE table" - field = "Enabled", fuelClosedLoopCorrectionEnabled - field = "!No correction below these value" - field = "CLT - low threshod", fuelClosedLoopCltThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "RPM - low threshod", fuelClosedLoopRpmThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - low threshod", fuelClosedLoopAfrLowThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!No correction above these value" - field = "TPS - high threshod", fuelClosedLoopTpsThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - high threshod", fuelClosedLoopAfrHighThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!PID settings" - field = "P factor", fuelClosedLoopPid_pFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "I factor", fuelClosedLoopPid_iFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "D factor", fuelClosedLoopPid_dFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "min", fuelClosedLoopPid_minValue, {fuelClosedLoopCorrectionEnabled == 1} - field = "max", fuelClosedLoopPid_maxValue, {fuelClosedLoopCorrectionEnabled == 1} + dialog = stftPartitioning, "Region Configuration" + field = "Idle region RPM", stft_maxIdleRegionRpm + field = "Overrun region load", stft_maxOverrunLoad + field = "Power region load", stft_minPowerLoad + dialog = stftPartitionSettingsMain, "Main Region", xAxis + field = "Time Const", stft_cellCfgs4_timeConstant + field = "Max add", stft_cellCfgs4_maxAdd + field = "Max remove", stft_cellCfgs4_maxRemove + + dialog = stftPartitionSettingsIdle, "Idle Region", xAxis + field = "Time Const", stft_cellCfgs1_timeConstant + field = "Max add", stft_cellCfgs1_maxAdd + field = "Max remove", stft_cellCfgs1_maxRemove + + dialog = stftPartitionSettingsPower, "Power Region", xAxis + field = "Time Const", stft_cellCfgs3_timeConstant + field = "Max add", stft_cellCfgs3_maxAdd + field = "Max remove", stft_cellCfgs3_maxRemove + + dialog = stftPartitionSettingsOverrun, "Overrun Region", xAxis + field = "Time Const", stft_cellCfgs2_timeConstant + field = "Max add", stft_cellCfgs2_maxAdd + field = "Max remove", stft_cellCfgs2_maxRemove + + dialog = fuelClosedLoopDialog, "Short-term fuel trim" + field = "Enabled", fuelClosedLoopCorrectionEnabled + + field = "Startup delay" stft_startupDelay, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum CLT for correction", stft_minClt, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum AFR for correction", stft_minAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Maximum AFR for correction", stft_maxAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Adjustment deadband", stft_deadband, {fuelClosedLoopCorrectionEnabled == 1} + field = "Ignore error magnitude", stftIgnoreErrorMagnitude, {fuelClosedLoopCorrectionEnabled == 1} + + panel = stftPartitioning, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsMain, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsIdle, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsPower, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsOverrun, {fuelClosedLoopCorrectionEnabled == 1} dialog = auxPidDialog, "Aux PID" field = "Enabled", activateAuxPid1 diff --git a/firmware/tunerstudio/rusefi_prometheus.ini b/firmware/tunerstudio/rusefi_prometheus.ini index c8f3d79569..100b45a9e8 100644 --- a/firmware/tunerstudio/rusefi_prometheus.ini +++ b/firmware/tunerstudio/rusefi_prometheus.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Fri May 29 21:22:38 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:41 EDT 2020 pageSize = 20000 page = 1 @@ -341,7 +341,7 @@ page = 1 fuelLevelEmptyTankVoltage = scalar, F32, 684, "V", 1, 0, 0,10, 2 fuelLevelFullTankVoltage = scalar, F32, 688, "V", 1, 0, 0,10, 2 afr_type = bits, S32, 692, [0:7], "BPSX", "Innovate", "14Point7", "Narrow", "PLX", "Custom" - fuelClosedLoopAfrLowThreshold = scalar, F32, 696, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused696 offset 696 triggerInputPins1 = bits, U08, 700, [0:7], "NONE", "INVALID", "INVALID", "PA1", "PA2", "PA3", "INVALID", "PA5", "PA6", "PA7", "PA8", "PA9", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PA15", "INVALID", "INVALID", "INVALID", "PB3", "PB4", "PB5", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "PC7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "PE6", "INVALID", "INVALID", "PE9", "INVALID", "PE11", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" triggerInputPins2 = bits, U08, 701, [0:7], "NONE", "INVALID", "INVALID", "PA1", "PA2", "PA3", "INVALID", "PA5", "PA6", "PA7", "PA8", "PA9", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PA15", "INVALID", "INVALID", "INVALID", "PB3", "PB4", "PB5", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "PC7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "PE6", "INVALID", "INVALID", "PE9", "INVALID", "PE11", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" triggerInputPins3 = bits, U08, 702, [0:7], "NONE", "INVALID", "INVALID", "PA1", "PA2", "PA3", "INVALID", "PA5", "PA6", "PA7", "PA8", "PA9", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PA15", "INVALID", "INVALID", "INVALID", "PB3", "PB4", "PB5", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "PC7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "PE6", "INVALID", "INVALID", "PE9", "INVALID", "PE11", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" @@ -895,18 +895,9 @@ page = 1 auxTempSensor2_bias_resistor = scalar, F32, 2500, "Ohm", 1, 0, 0, 200000, 1 auxTempSensor2_adcChannel = bits, U08, 2504, [0:7] "Analog 3O","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","NONE" ;no TS info - skipping auxTempSensor2_alignmentFill_at_29 offset 2505 - fuelClosedLoopCltThreshold = scalar, S16, 2508, "C", 1, 0, 0, 100, 0 - fuelClosedLoopTpsThreshold = scalar, S16, 2510, "%", 1, 0, 0, 100, 0 - fuelClosedLoopRpmThreshold = scalar, S16, 2512, "rpm", 1, 0, 0, 5000, 0 +;no TS info - skipping unused2508 offset 2508 etbFreq = scalar, S16, 2514, "Hz", 1, 0, 0, 30000, 0 - fuelClosedLoopPid_pFactor = scalar, F32, 2516, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_iFactor = scalar, F32, 2520, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_dFactor = scalar, F32, 2524, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_offset = scalar, S16, 2528, "", 1, 0, -1000, 1000, 0 - fuelClosedLoopPid_periodMs = scalar, S16, 2530, "ms", 1, 0, 0, 3000, 0 - fuelClosedLoopPid_minValue = scalar, S16, 2532, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopPid_maxValue = scalar, S16, 2534, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopAfrHighThreshold = scalar, F32, 2536, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused2516 offset 2516 timing_offset_cylinder1 = scalar, F32, 2540, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder2 = scalar, F32, 2544, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder3 = scalar, F32, 2548, "Val", 1, 0, -20000000, 20000000, 1 @@ -1545,7 +1536,7 @@ page = 1 iatCorrection = scalar, S16, 64, "%",{1/100}, 0 cltCorrection = scalar, S16, 66, "%",{1/100}, 0 baroCorrection = scalar, S16, 68, "%",{1/100}, 0 - fuelPidCorrection=scalar, S16, 70, "ms",{1/300}, 0 + fuelPidCorrection=scalar, S16, 70, "%",{1/100}, 0 ; Wall model AE wallFuelAmount = scalar, U16, 72, "ms",{1/300}, 0 @@ -2280,7 +2271,7 @@ gaugeCategory = Fueling injectorLagMsGauge = injectorLagMs, "fuel: injector lag", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 fuelRunningGauge = fuelRunning, "fuel: running", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 baseFuelGauge = baseFuel, "fuel: base", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 - fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term closed loop correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1 + fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term fuel trim", "%", -10, 10, -8, -5, 5, 8, 3, 1 gaugeCategory = Throttle Body (incl. ETB) pedalPositionGauge = throttlePedalPosition, "Throttle pedal position", "%", 0, 120, 0, 0, 100, 100, 1, 1 @@ -2413,7 +2404,7 @@ gaugeCategory = Sensors - Raw entry = fuelRunning, "fuel: running", float, "%.3f" entry = actualLastInjection, "fuel: Last injection", float, "%.3f" entry = baseFuel, "fuel: base", float, "%.2f" - entry = fuelPidCorrection,"fuel: Short-term closed loop correction", float, "%.2f" + entry = fuelPidCorrection,"fuel: Short-term fuel trim", float, "%.2f" entry = veValue, "fuel: VE", float, "%.3f" entry = injectorDutyCycle,"fuel: injector duty cycle",float,"%.3f" entry = coilDutyCycle, "dwell: coil duty cycle", float,"%.3f" @@ -2552,7 +2543,7 @@ menuDialog = main # Targets & closed loop subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled == 1 && (fuelAlgorithm == LM_SPEED_DENSITY || fuelAlgorithm == LM_REAL_MAF)} - subMenu = fuelClosedLoopDialog, "Closed loop correction", 0, {isInjectionEnabled == 1} + subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled == 1} subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled == 1} subMenu = std_separator @@ -2716,12 +2707,12 @@ menuDialog = main subMenu = std_separator subMenu = std_separator - subMenu = smLaunchControl, "Launch Control" - subMenu = std_separator - subMenu = smRollingLaunch, "Rolling Launch" - subMenu = std_separator - subMenu = antiLag, "Antilag Setup" - subMenu = std_separator +# subMenu = smLaunchControl, "Launch Control" +# subMenu = std_separator +# subMenu = smRollingLaunch, "Rolling Launch" +# subMenu = std_separator +# subMenu = antiLag, "Antilag Setup" +# subMenu = std_separator menu = "Help" @@ -3719,23 +3710,46 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "SPI3sck mode", spi3SckMode, {is_enabled_spi_3 == 1} field = "LIS302DLCsPin", LIS302DLCsPin - dialog = fuelClosedLoopDialog, "Fuel short-term closed-loop correction" - field = "#This is just the cherry on the cake once you have good VE table" - field = "Enabled", fuelClosedLoopCorrectionEnabled - field = "!No correction below these value" - field = "CLT - low threshod", fuelClosedLoopCltThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "RPM - low threshod", fuelClosedLoopRpmThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - low threshod", fuelClosedLoopAfrLowThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!No correction above these value" - field = "TPS - high threshod", fuelClosedLoopTpsThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - high threshod", fuelClosedLoopAfrHighThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!PID settings" - field = "P factor", fuelClosedLoopPid_pFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "I factor", fuelClosedLoopPid_iFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "D factor", fuelClosedLoopPid_dFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "min", fuelClosedLoopPid_minValue, {fuelClosedLoopCorrectionEnabled == 1} - field = "max", fuelClosedLoopPid_maxValue, {fuelClosedLoopCorrectionEnabled == 1} + dialog = stftPartitioning, "Region Configuration" + field = "Idle region RPM", stft_maxIdleRegionRpm + field = "Overrun region load", stft_maxOverrunLoad + field = "Power region load", stft_minPowerLoad + dialog = stftPartitionSettingsMain, "Main Region", xAxis + field = "Time Const", stft_cellCfgs4_timeConstant + field = "Max add", stft_cellCfgs4_maxAdd + field = "Max remove", stft_cellCfgs4_maxRemove + + dialog = stftPartitionSettingsIdle, "Idle Region", xAxis + field = "Time Const", stft_cellCfgs1_timeConstant + field = "Max add", stft_cellCfgs1_maxAdd + field = "Max remove", stft_cellCfgs1_maxRemove + + dialog = stftPartitionSettingsPower, "Power Region", xAxis + field = "Time Const", stft_cellCfgs3_timeConstant + field = "Max add", stft_cellCfgs3_maxAdd + field = "Max remove", stft_cellCfgs3_maxRemove + + dialog = stftPartitionSettingsOverrun, "Overrun Region", xAxis + field = "Time Const", stft_cellCfgs2_timeConstant + field = "Max add", stft_cellCfgs2_maxAdd + field = "Max remove", stft_cellCfgs2_maxRemove + + dialog = fuelClosedLoopDialog, "Short-term fuel trim" + field = "Enabled", fuelClosedLoopCorrectionEnabled + + field = "Startup delay" stft_startupDelay, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum CLT for correction", stft_minClt, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum AFR for correction", stft_minAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Maximum AFR for correction", stft_maxAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Adjustment deadband", stft_deadband, {fuelClosedLoopCorrectionEnabled == 1} + field = "Ignore error magnitude", stftIgnoreErrorMagnitude, {fuelClosedLoopCorrectionEnabled == 1} + + panel = stftPartitioning, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsMain, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsIdle, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsPower, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsOverrun, {fuelClosedLoopCorrectionEnabled == 1} dialog = auxPidDialog, "Aux PID" field = "Enabled", activateAuxPid1 diff --git a/firmware/tunerstudio/rusefi_proteus.ini b/firmware/tunerstudio/rusefi_proteus.ini index 5be83e2894..bfd9ce92cc 100644 --- a/firmware/tunerstudio/rusefi_proteus.ini +++ b/firmware/tunerstudio/rusefi_proteus.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Fri May 29 21:22:40 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:44 EDT 2020 pageSize = 20000 page = 1 @@ -341,7 +341,7 @@ page = 1 fuelLevelEmptyTankVoltage = scalar, F32, 684, "V", 1, 0, 0,10, 2 fuelLevelFullTankVoltage = scalar, F32, 688, "V", 1, 0, 0,10, 2 afr_type = bits, S32, 692, [0:7], "BPSX", "Innovate", "14Point7", "Narrow", "PLX", "Custom" - fuelClosedLoopAfrLowThreshold = scalar, F32, 696, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused696 offset 696 triggerInputPins1 = bits, U08, 700, [0:7], "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","Digital 1","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","VR 1","VR 2","INVALID","INVALID","Digital 2","Digital 3","Digital 4","Digital 5","Digital 6","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" triggerInputPins2 = bits, U08, 701, [0:7], "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","Digital 1","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","VR 1","VR 2","INVALID","INVALID","Digital 2","Digital 3","Digital 4","Digital 5","Digital 6","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" triggerInputPins3 = bits, U08, 702, [0:7], "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","Digital 1","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","VR 1","VR 2","INVALID","INVALID","Digital 2","Digital 3","Digital 4","Digital 5","Digital 6","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" @@ -895,18 +895,9 @@ page = 1 auxTempSensor2_bias_resistor = scalar, F32, 2500, "Ohm", 1, 0, 0, 200000, 1 auxTempSensor2_adcChannel = bits, U08, 2504, [0:7] "Analog Volt 5","Analog Volt 6","Analog Volt 7","Analog Volt 8","Analog Volt 9","Analog Volt 10","Analog Volt 11","Battery Sense","Analog Temp 3","Analog Temp 4","Analog Volt 1","Analog Volt 2","Analog Volt 3","Analog Volt 4","Analog Temp 1","Analog Temp 2","NONE" ;no TS info - skipping auxTempSensor2_alignmentFill_at_29 offset 2505 - fuelClosedLoopCltThreshold = scalar, S16, 2508, "C", 1, 0, 0, 100, 0 - fuelClosedLoopTpsThreshold = scalar, S16, 2510, "%", 1, 0, 0, 100, 0 - fuelClosedLoopRpmThreshold = scalar, S16, 2512, "rpm", 1, 0, 0, 5000, 0 +;no TS info - skipping unused2508 offset 2508 etbFreq = scalar, S16, 2514, "Hz", 1, 0, 0, 30000, 0 - fuelClosedLoopPid_pFactor = scalar, F32, 2516, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_iFactor = scalar, F32, 2520, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_dFactor = scalar, F32, 2524, "", 1, 0, -10000, 10000, 4 - fuelClosedLoopPid_offset = scalar, S16, 2528, "", 1, 0, -1000, 1000, 0 - fuelClosedLoopPid_periodMs = scalar, S16, 2530, "ms", 1, 0, 0, 3000, 0 - fuelClosedLoopPid_minValue = scalar, S16, 2532, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopPid_maxValue = scalar, S16, 2534, "", 1, 0, -30000, 30000.0, 0 - fuelClosedLoopAfrHighThreshold = scalar, F32, 2536, "ratio", 1, 0, 0, 100, 1 +;no TS info - skipping unused2516 offset 2516 timing_offset_cylinder1 = scalar, F32, 2540, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder2 = scalar, F32, 2544, "Val", 1, 0, -20000000, 20000000, 1 timing_offset_cylinder3 = scalar, F32, 2548, "Val", 1, 0, -20000000, 20000000, 1 @@ -1545,7 +1536,7 @@ page = 1 iatCorrection = scalar, S16, 64, "%",{1/100}, 0 cltCorrection = scalar, S16, 66, "%",{1/100}, 0 baroCorrection = scalar, S16, 68, "%",{1/100}, 0 - fuelPidCorrection=scalar, S16, 70, "ms",{1/300}, 0 + fuelPidCorrection=scalar, S16, 70, "%",{1/100}, 0 ; Wall model AE wallFuelAmount = scalar, U16, 72, "ms",{1/300}, 0 @@ -2280,7 +2271,7 @@ gaugeCategory = Fueling injectorLagMsGauge = injectorLagMs, "fuel: injector lag", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 fuelRunningGauge = fuelRunning, "fuel: running", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 baseFuelGauge = baseFuel, "fuel: base", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 - fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term closed loop correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1 + fuelPidCorrectionGauge = fuelPidCorrection, "fuel: Short-term fuel trim", "%", -10, 10, -8, -5, 5, 8, 3, 1 gaugeCategory = Throttle Body (incl. ETB) pedalPositionGauge = throttlePedalPosition, "Throttle pedal position", "%", 0, 120, 0, 0, 100, 100, 1, 1 @@ -2413,7 +2404,7 @@ gaugeCategory = Sensors - Raw entry = fuelRunning, "fuel: running", float, "%.3f" entry = actualLastInjection, "fuel: Last injection", float, "%.3f" entry = baseFuel, "fuel: base", float, "%.2f" - entry = fuelPidCorrection,"fuel: Short-term closed loop correction", float, "%.2f" + entry = fuelPidCorrection,"fuel: Short-term fuel trim", float, "%.2f" entry = veValue, "fuel: VE", float, "%.3f" entry = injectorDutyCycle,"fuel: injector duty cycle",float,"%.3f" entry = coilDutyCycle, "dwell: coil duty cycle", float,"%.3f" @@ -2552,7 +2543,7 @@ menuDialog = main # Targets & closed loop subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled == 1 && (fuelAlgorithm == LM_SPEED_DENSITY || fuelAlgorithm == LM_REAL_MAF)} - subMenu = fuelClosedLoopDialog, "Closed loop correction", 0, {isInjectionEnabled == 1} + subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled == 1} subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled == 1} subMenu = std_separator @@ -2711,12 +2702,12 @@ menuDialog = main subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" subMenu = pedalToTpsTbl, "Electronic Pedal Map" subMenu = std_separator - subMenu = smLaunchControl, "Launch Control" - subMenu = std_separator - subMenu = smRollingLaunch, "Rolling Launch" - subMenu = std_separator - subMenu = antiLag, "Antilag Setup" - subMenu = std_separator +# subMenu = smLaunchControl, "Launch Control" +# subMenu = std_separator +# subMenu = smRollingLaunch, "Rolling Launch" +# subMenu = std_separator +# subMenu = antiLag, "Antilag Setup" +# subMenu = std_separator menu = "Help" @@ -3698,23 +3689,46 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "SPI3sck mode", spi3SckMode, {is_enabled_spi_3 == 1} field = "LIS302DLCsPin", LIS302DLCsPin - dialog = fuelClosedLoopDialog, "Fuel short-term closed-loop correction" - field = "#This is just the cherry on the cake once you have good VE table" - field = "Enabled", fuelClosedLoopCorrectionEnabled - field = "!No correction below these value" - field = "CLT - low threshod", fuelClosedLoopCltThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "RPM - low threshod", fuelClosedLoopRpmThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - low threshod", fuelClosedLoopAfrLowThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!No correction above these value" - field = "TPS - high threshod", fuelClosedLoopTpsThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "EGO - high threshod", fuelClosedLoopAfrHighThreshold, {fuelClosedLoopCorrectionEnabled == 1} - field = "!PID settings" - field = "P factor", fuelClosedLoopPid_pFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "I factor", fuelClosedLoopPid_iFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "D factor", fuelClosedLoopPid_dFactor, {fuelClosedLoopCorrectionEnabled == 1} - field = "min", fuelClosedLoopPid_minValue, {fuelClosedLoopCorrectionEnabled == 1} - field = "max", fuelClosedLoopPid_maxValue, {fuelClosedLoopCorrectionEnabled == 1} + dialog = stftPartitioning, "Region Configuration" + field = "Idle region RPM", stft_maxIdleRegionRpm + field = "Overrun region load", stft_maxOverrunLoad + field = "Power region load", stft_minPowerLoad + dialog = stftPartitionSettingsMain, "Main Region", xAxis + field = "Time Const", stft_cellCfgs4_timeConstant + field = "Max add", stft_cellCfgs4_maxAdd + field = "Max remove", stft_cellCfgs4_maxRemove + + dialog = stftPartitionSettingsIdle, "Idle Region", xAxis + field = "Time Const", stft_cellCfgs1_timeConstant + field = "Max add", stft_cellCfgs1_maxAdd + field = "Max remove", stft_cellCfgs1_maxRemove + + dialog = stftPartitionSettingsPower, "Power Region", xAxis + field = "Time Const", stft_cellCfgs3_timeConstant + field = "Max add", stft_cellCfgs3_maxAdd + field = "Max remove", stft_cellCfgs3_maxRemove + + dialog = stftPartitionSettingsOverrun, "Overrun Region", xAxis + field = "Time Const", stft_cellCfgs2_timeConstant + field = "Max add", stft_cellCfgs2_maxAdd + field = "Max remove", stft_cellCfgs2_maxRemove + + dialog = fuelClosedLoopDialog, "Short-term fuel trim" + field = "Enabled", fuelClosedLoopCorrectionEnabled + + field = "Startup delay" stft_startupDelay, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum CLT for correction", stft_minClt, {fuelClosedLoopCorrectionEnabled == 1} + field = "Minimum AFR for correction", stft_minAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Maximum AFR for correction", stft_maxAfr, {fuelClosedLoopCorrectionEnabled == 1} + field = "Adjustment deadband", stft_deadband, {fuelClosedLoopCorrectionEnabled == 1} + field = "Ignore error magnitude", stftIgnoreErrorMagnitude, {fuelClosedLoopCorrectionEnabled == 1} + + panel = stftPartitioning, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsMain, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsIdle, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsPower, {fuelClosedLoopCorrectionEnabled == 1} + panel = stftPartitionSettingsOverrun, {fuelClosedLoopCorrectionEnabled == 1} dialog = auxPidDialog, "Aux PID" field = "Enabled", activateAuxPid1 diff --git a/firmware/util/datalogging.cpp b/firmware/util/datalogging.cpp index e7fdf7333c..e5fdfbe128 100644 --- a/firmware/util/datalogging.cpp +++ b/firmware/util/datalogging.cpp @@ -225,7 +225,7 @@ void printWithLength(char *line) { } void appendMsgPrefix(Logging *logging) { - append(logging, "msg" DELIMETER); + append(logging, PROTOCOL_MSG DELIMETER); } void appendMsgPostfix(Logging *logging) { diff --git a/java_console/io/src/com/rusefi/binaryprotocol/BinaryProtocol.java b/java_console/io/src/com/rusefi/binaryprotocol/BinaryProtocol.java index b5ef8a33ae..f3848492d7 100644 --- a/java_console/io/src/com/rusefi/binaryprotocol/BinaryProtocol.java +++ b/java_console/io/src/com/rusefi/binaryprotocol/BinaryProtocol.java @@ -20,7 +20,6 @@ import jssc.SerialPortException; import org.jetbrains.annotations.Nullable; import java.io.EOFException; -import java.io.FileWriter; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -99,11 +98,16 @@ public class BinaryProtocol implements BinaryProtocolCommands { this.logger = logger; this.stream = stream; - incomingData = new IncomingDataBuffer(logger); - stream.setInputListener(incomingData::addData); + incomingData = createDataBuffer(stream, logger); } - private static void sleep(int millis) { + public static IncomingDataBuffer createDataBuffer(IoStream stream, Logger logger) { + IncomingDataBuffer incomingData = new IncomingDataBuffer(logger); + stream.setInputListener(incomingData::addData); + return incomingData; + } + + public static void sleep(int millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { diff --git a/java_console/io/src/com/rusefi/binaryprotocol/IncomingDataBuffer.java b/java_console/io/src/com/rusefi/binaryprotocol/IncomingDataBuffer.java index 795eb6dd37..59b12f58f6 100644 --- a/java_console/io/src/com/rusefi/binaryprotocol/IncomingDataBuffer.java +++ b/java_console/io/src/com/rusefi/binaryprotocol/IncomingDataBuffer.java @@ -31,6 +31,10 @@ public class IncomingDataBuffer { this.logger = logger; } + public byte[] getPacket(Logger logger, String msg, boolean allowLongResponse) throws InterruptedException, EOFException { + return getPacket(logger, msg, allowLongResponse, System.currentTimeMillis()); + } + public byte[] getPacket(Logger logger, String msg, boolean allowLongResponse, long start) throws InterruptedException, EOFException { boolean isTimeout = waitForBytes(msg + " header", start, 2); if (isTimeout) diff --git a/java_console/io/src/com/rusefi/io/LinkConnector.java b/java_console/io/src/com/rusefi/io/LinkConnector.java index 60f5cbbe2b..6698bb381d 100644 --- a/java_console/io/src/com/rusefi/io/LinkConnector.java +++ b/java_console/io/src/com/rusefi/io/LinkConnector.java @@ -24,11 +24,6 @@ public interface LinkConnector extends LinkDecoder { public BinaryProtocol getBinaryProtocol() { return null; } - - @Override - public String unpack(String packet) { - return LinkDecoder.TEXT_PROTOCOL_DECODER.unpack(packet); - } }; void connectAndReadConfiguration(ConnectionStateListener listener); diff --git a/java_console/io/src/com/rusefi/io/LinkManager.java b/java_console/io/src/com/rusefi/io/LinkManager.java index 08845b670b..50f20b3c70 100644 --- a/java_console/io/src/com/rusefi/io/LinkManager.java +++ b/java_console/io/src/com/rusefi/io/LinkManager.java @@ -63,7 +63,7 @@ public class LinkManager { public static LinkDecoder ENCODER = new LinkDecoder() { @Override public String unpack(String packedLine) { - return LinkManager.unpack(packedLine); + return packedLine; } }; @@ -169,10 +169,6 @@ public class LinkManager { connector.restart(); } - public static String unpack(String packet) { - return connector.unpack(packet); - } - public static String unpackConfirmation(String message) { if (message.startsWith(CommandQueue.CONFIRMATION_PREFIX)) return message.substring(CommandQueue.CONFIRMATION_PREFIX.length()); diff --git a/java_console/io/src/com/rusefi/io/tcp/TcpConnector.java b/java_console/io/src/com/rusefi/io/tcp/TcpConnector.java index debea1793b..b99b180d3a 100644 --- a/java_console/io/src/com/rusefi/io/tcp/TcpConnector.java +++ b/java_console/io/src/com/rusefi/io/tcp/TcpConnector.java @@ -136,11 +136,6 @@ public class TcpConnector implements LinkConnector { public void restart() { } - @Override - public String unpack(String packet) { - return packet; - } - @Override public void send(String command, boolean fireEvent) throws InterruptedException { if (bp == null) { diff --git a/java_console/models/src/com/rusefi/config/generated/Fields.java b/java_console/models/src/com/rusefi/config/generated/Fields.java index f5d058e87d..3846171ca2 100644 --- a/java_console/models/src/com/rusefi/config/generated/Fields.java +++ b/java_console/models/src/com/rusefi/config/generated/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config.generated; -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sat May 30 12:18:04 EDT 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon Jun 01 07:18:30 EDT 2020 // by class com.rusefi.output.FileJavaFieldsConsumer import com.rusefi.config.*; @@ -505,20 +505,7 @@ public class Fields { public static final int FUEL_LOAD_COUNT = 16; public static final int FUEL_RPM_COUNT = 16; public static final int fuelAlgorithm_offset = 420; - public static final int fuelClosedLoopAfrHighThreshold_offset = 2536; - public static final int fuelClosedLoopAfrLowThreshold_offset = 696; - public static final int fuelClosedLoopCltThreshold_offset = 2508; public static final int fuelClosedLoopCorrectionEnabled_offset = 1464; - public static final int fuelClosedLoopPid_dFactor_offset = 2524; - public static final int fuelClosedLoopPid_iFactor_offset = 2520; - public static final int fuelClosedLoopPid_maxValue_offset = 2534; - public static final int fuelClosedLoopPid_minValue_offset = 2532; - public static final int fuelClosedLoopPid_offset = 2516; - public static final int fuelClosedLoopPid_offset_offset = 2528; - public static final int fuelClosedLoopPid_periodMs_offset = 2530; - public static final int fuelClosedLoopPid_pFactor_offset = 2516; - public static final int fuelClosedLoopRpmThreshold_offset = 2512; - public static final int fuelClosedLoopTpsThreshold_offset = 2510; public static final int fuelLevelEmptyTankVoltage_offset = 684; public static final int fuelLevelFullTankVoltage_offset = 688; public static final int fuelLevelSensor_offset = 514; @@ -564,7 +551,7 @@ public class Fields { public static final String GAUGE_NAME_FUEL_IAT_CORR = "fuel: IAT correction"; public static final String GAUGE_NAME_FUEL_INJ_DUTY = "fuel: injector duty cycle"; public static final String GAUGE_NAME_FUEL_LAST_INJECTION = "fuel: Last injection"; - public static final String GAUGE_NAME_FUEL_PID_CORR = "fuel: Short-term closed loop correction"; + public static final String GAUGE_NAME_FUEL_PID_CORR = "fuel: Short-term fuel trim"; public static final String GAUGE_NAME_FUEL_RUNNING = "fuel: running"; public static final String GAUGE_NAME_FUEL_TPS_EXTRA = "fuel: TPS acceleration extra fuel ms"; public static final String GAUGE_NAME_FUEL_TPS_ROC = "fuel: TPS change"; @@ -1007,8 +994,10 @@ public class Fields { public static final String PROTOCOL_ENGINE_SNIFFER = "wave_chart"; public static final String PROTOCOL_ES_DOWN = "d"; public static final String PROTOCOL_ES_UP = "u"; + public static final String PROTOCOL_HELLO_PREFIX = "***"; public static final String PROTOCOL_HIP_NAME = "HIP"; public static final String PROTOCOL_INJ1_SHORT_NAME = "i1"; + public static final String PROTOCOL_MSG = "msg"; public static final String PROTOCOL_OUTPIN = "outpin"; public static final String PROTOCOL_TACH_NAME = "tach"; public static final String PROTOCOL_TEST_RESPONSE_TAG = "ts_p_alive"; @@ -1284,7 +1273,10 @@ public class Fields { public static final int unused1059_offset = 3964; public static final int unused1476b20_offset = 1476; public static final int unused2432_offset = 2432; + public static final int unused2508_offset = 2508; + public static final int unused2516_offset = 2516; public static final int unused6312_offset = 6312; + public static final int unused696_offset = 696; public static final int unused711_offset = 711; public static final int unused806_offset = 806; public static final int unused_1484_bit_24_offset = 1476; @@ -1633,7 +1625,7 @@ public class Fields { public static final Field FUELLEVELFULLTANKVOLTAGE = Field.create("FUELLEVELFULLTANKVOLTAGE", 688, FieldType.FLOAT); public static final String[] ego_sensor_e = {"BPSX", "Innovate", "14Point7", "Narrow", "PLX", "Custom"}; public static final Field AFR_TYPE = Field.create("AFR_TYPE", 692, FieldType.INT, ego_sensor_e); - public static final Field FUELCLOSEDLOOPAFRLOWTHRESHOLD = Field.create("FUELCLOSEDLOOPAFRLOWTHRESHOLD", 696, FieldType.FLOAT); + public static final Field UNUSED696 = Field.create("UNUSED696", 696, FieldType.INT); public static final Field TRIGGERINPUTPINS1 = Field.create("TRIGGERINPUTPINS1", 700, FieldType.INT8, brain_input_pin_e); public static final Field TRIGGERINPUTPINS2 = Field.create("TRIGGERINPUTPINS2", 701, FieldType.INT8, brain_input_pin_e); public static final Field TRIGGERINPUTPINS3 = Field.create("TRIGGERINPUTPINS3", 702, FieldType.INT8, brain_input_pin_e); @@ -2173,18 +2165,7 @@ public class Fields { public static final Field AUXTEMPSENSOR2_RESISTANCE_3 = Field.create("AUXTEMPSENSOR2_RESISTANCE_3", 2496, FieldType.FLOAT); public static final Field AUXTEMPSENSOR2_BIAS_RESISTOR = Field.create("AUXTEMPSENSOR2_BIAS_RESISTOR", 2500, FieldType.FLOAT); public static final Field AUXTEMPSENSOR2_ADCCHANNEL = Field.create("AUXTEMPSENSOR2_ADCCHANNEL", 2504, FieldType.INT8, adc_channel_e); - public static final Field FUELCLOSEDLOOPCLTTHRESHOLD = Field.create("FUELCLOSEDLOOPCLTTHRESHOLD", 2508, FieldType.INT16); - public static final Field FUELCLOSEDLOOPTPSTHRESHOLD = Field.create("FUELCLOSEDLOOPTPSTHRESHOLD", 2510, FieldType.INT16); - public static final Field FUELCLOSEDLOOPRPMTHRESHOLD = Field.create("FUELCLOSEDLOOPRPMTHRESHOLD", 2512, FieldType.INT16); public static final Field ETBFREQ = Field.create("ETBFREQ", 2514, FieldType.INT16); - public static final Field FUELCLOSEDLOOPPID_PFACTOR = Field.create("FUELCLOSEDLOOPPID_PFACTOR", 2516, FieldType.FLOAT); - public static final Field FUELCLOSEDLOOPPID_IFACTOR = Field.create("FUELCLOSEDLOOPPID_IFACTOR", 2520, FieldType.FLOAT); - public static final Field FUELCLOSEDLOOPPID_DFACTOR = Field.create("FUELCLOSEDLOOPPID_DFACTOR", 2524, FieldType.FLOAT); - public static final Field FUELCLOSEDLOOPPID_OFFSET = Field.create("FUELCLOSEDLOOPPID_OFFSET", 2528, FieldType.INT16); - public static final Field FUELCLOSEDLOOPPID_PERIODMS = Field.create("FUELCLOSEDLOOPPID_PERIODMS", 2530, FieldType.INT16); - public static final Field FUELCLOSEDLOOPPID_MINVALUE = Field.create("FUELCLOSEDLOOPPID_MINVALUE", 2532, FieldType.INT16); - public static final Field FUELCLOSEDLOOPPID_MAXVALUE = Field.create("FUELCLOSEDLOOPPID_MAXVALUE", 2534, FieldType.INT16); - public static final Field FUELCLOSEDLOOPAFRHIGHTHRESHOLD = Field.create("FUELCLOSEDLOOPAFRHIGHTHRESHOLD", 2536, FieldType.FLOAT); public static final Field TIMING_OFFSET_CYLINDER1 = Field.create("TIMING_OFFSET_CYLINDER1", 2540, FieldType.INT); public static final Field TIMING_OFFSET_CYLINDER2 = Field.create("TIMING_OFFSET_CYLINDER2", 2544, FieldType.INT); public static final Field TIMING_OFFSET_CYLINDER3 = Field.create("TIMING_OFFSET_CYLINDER3", 2548, FieldType.INT); @@ -2630,7 +2611,7 @@ public class Fields { FUELLEVELEMPTYTANKVOLTAGE, FUELLEVELFULLTANKVOLTAGE, AFR_TYPE, - FUELCLOSEDLOOPAFRLOWTHRESHOLD, + UNUSED696, TRIGGERINPUTPINS1, TRIGGERINPUTPINS2, TRIGGERINPUTPINS3, @@ -3163,18 +3144,7 @@ public class Fields { AUXTEMPSENSOR2_RESISTANCE_3, AUXTEMPSENSOR2_BIAS_RESISTOR, AUXTEMPSENSOR2_ADCCHANNEL, - FUELCLOSEDLOOPCLTTHRESHOLD, - FUELCLOSEDLOOPTPSTHRESHOLD, - FUELCLOSEDLOOPRPMTHRESHOLD, ETBFREQ, - FUELCLOSEDLOOPPID_PFACTOR, - FUELCLOSEDLOOPPID_IFACTOR, - FUELCLOSEDLOOPPID_DFACTOR, - FUELCLOSEDLOOPPID_OFFSET, - FUELCLOSEDLOOPPID_PERIODMS, - FUELCLOSEDLOOPPID_MINVALUE, - FUELCLOSEDLOOPPID_MAXVALUE, - FUELCLOSEDLOOPAFRHIGHTHRESHOLD, TIMING_OFFSET_CYLINDER1, TIMING_OFFSET_CYLINDER2, TIMING_OFFSET_CYLINDER3, diff --git a/java_console/models/src/com/rusefi/core/EngineState.java b/java_console/models/src/com/rusefi/core/EngineState.java index 79c85e957b..ecf77cfad8 100644 --- a/java_console/models/src/com/rusefi/core/EngineState.java +++ b/java_console/models/src/com/rusefi/core/EngineState.java @@ -29,10 +29,10 @@ public class EngineState { /** * text protocol key and callback associated with this key */ - private static class StringActionPair extends Pair> { + public static class StringActionPair extends Pair> { public final String prefix; - StringActionPair(String key, ValueCallback second) { + public StringActionPair(String key, ValueCallback second) { super(key, second); prefix = key.toLowerCase() + SEPARATOR; } @@ -53,6 +53,7 @@ public class EngineState { buffer = new ResponseBuffer(new ResponseBuffer.ResponseListener() { public void onResponse(String response) { if (response != null) { + // let's remove timestamp if we get content from a log file not controller int i = response.indexOf(FileLog.END_OF_TIMESTAND_TAG); if (i != -1) response = response.substring(i + FileLog.END_OF_TIMESTAND_TAG.length()); @@ -172,7 +173,16 @@ public class EngineState { return response; } - private String handleStringActionPair(String response, StringActionPair pair, EngineStateListener listener) { + public static String skipToken(String string) { + int keyEnd = string.indexOf(SEPARATOR); + if (keyEnd == -1) { + // discarding invalid line + return ""; + } + return string.substring(keyEnd + SEPARATOR.length()); + } + + public static String handleStringActionPair(String response, StringActionPair pair, EngineStateListener listener) { if (startWithIgnoreCase(response, pair.prefix)) { String key = pair.first; int beginIndex = key.length() + 1; @@ -182,7 +192,8 @@ public class EngineState { String strValue = response.substring(beginIndex, endIndex); pair.second.onUpdate(strValue); - listener.onKeyValue(key, strValue); + if (listener != null) + listener.onKeyValue(key, strValue); response = response.substring(endIndex); if (!response.isEmpty()) diff --git a/java_console/models/src/com/rusefi/core/test/EngineStateTest.java b/java_console/models/src/com/rusefi/core/test/EngineStateTest.java index c8f969d82d..86e921750a 100644 --- a/java_console/models/src/com/rusefi/core/test/EngineStateTest.java +++ b/java_console/models/src/com/rusefi/core/test/EngineStateTest.java @@ -1,29 +1,16 @@ package com.rusefi.core.test; -import com.rusefi.core.SensorCentral; import com.rusefi.core.EngineState; -import com.rusefi.io.LinkDecoder; -import org.junit.Ignore; import org.junit.Test; -import java.util.concurrent.atomic.AtomicInteger; - -import static com.rusefi.core.EngineState.SEPARATOR; -import static junit.framework.Assert.*; +import static junit.framework.Assert.assertFalse; +import static junit.framework.Assert.assertTrue; /** * @author Andrey Belomutskiy * 12/26/12 */ public class EngineStateTest { - @Test - public void packUnpack() { - String a = "rpm,100,"; - String packed = EngineState.packString(a); - assertEquals("line:8:rpm,100,", packed); - assertEquals(a, LinkDecoder.TEXT_PROTOCOL_DECODER.unpack(packed)); - } - @Test public void startsWithIgnoreCase() { assertTrue(EngineState.startWithIgnoreCase("HELLO", "he")); diff --git a/java_console/models/src/com/rusefi/io/LinkDecoder.java b/java_console/models/src/com/rusefi/io/LinkDecoder.java index 17ee14972c..6646c0433c 100644 --- a/java_console/models/src/com/rusefi/io/LinkDecoder.java +++ b/java_console/models/src/com/rusefi/io/LinkDecoder.java @@ -1,25 +1,13 @@ package com.rusefi.io; -import com.rusefi.core.EngineState; - /** * (c) Andrey Belomutskiy * 6/20/2015. */ public interface LinkDecoder { - LinkDecoder TEXT_PROTOCOL_DECODER = new LinkDecoder() { - @Override - public String unpack(String packet) { - return EngineState.unpackString(packet); - } - }; + LinkDecoder VOID = new LinkDecoder() {}; - LinkDecoder VOID = new LinkDecoder() { - @Override - public String unpack(String packet) { - return packet; - } - }; - - String unpack(String packet); + default String unpack(String packet) { + return packet; + } } diff --git a/java_console/models/src/com/rusefi/rusEFIVersion.java b/java_console/models/src/com/rusefi/rusEFIVersion.java index 87f955712e..2c2df5a9c2 100644 --- a/java_console/models/src/com/rusefi/rusEFIVersion.java +++ b/java_console/models/src/com/rusefi/rusEFIVersion.java @@ -3,6 +3,6 @@ package com.rusefi; import java.util.concurrent.atomic.AtomicReference; public class rusEFIVersion { - public static final int CONSOLE_VERSION = 20200530; + public static final int CONSOLE_VERSION = 20200601; public static AtomicReference firmwareVersion = new AtomicReference<>("N/A"); } diff --git a/java_console/ui/src/com/rusefi/Launcher.java b/java_console/ui/src/com/rusefi/Launcher.java index d046c3d724..8498075a31 100644 --- a/java_console/ui/src/com/rusefi/Launcher.java +++ b/java_console/ui/src/com/rusefi/Launcher.java @@ -25,9 +25,9 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; import java.awt.event.ActionListener; +import java.util.Date; import java.util.HashMap; import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; @@ -182,6 +182,9 @@ public class Launcher extends rusEFIVersion { * @see StartupFrame if no parameters specified */ public static void main(final String[] args) throws Exception { + System.out.println("rusEfi UI console " + CONSOLE_VERSION); + System.out.println("Compiled " + new Date(ConsoleTools.classBuildTimeMillis())); + System.out.println("\n\n"); if (ConsoleTools.runTool(args)) { return; @@ -189,11 +192,8 @@ public class Launcher extends rusEFIVersion { ConsoleTools.printTools(); - System.out.println("Starting rusEfi UI console " + CONSOLE_VERSION); - FileLog.MAIN.start(); - getConfig().load(); FileLog.suspendLogging = getConfig().getRoot().getBoolProperty(GaugesPanel.DISABLE_LOGS); Thread.setDefaultUncaughtExceptionHandler(new DefaultExceptionHandler()); diff --git a/java_console/ui/src/com/rusefi/autodetect/SerialAutoChecker.java b/java_console/ui/src/com/rusefi/autodetect/SerialAutoChecker.java index e8e0e6f5f4..36f57fb42a 100644 --- a/java_console/ui/src/com/rusefi/autodetect/SerialAutoChecker.java +++ b/java_console/ui/src/com/rusefi/autodetect/SerialAutoChecker.java @@ -2,6 +2,7 @@ package com.rusefi.autodetect; import com.opensr5.Logger; import com.rusefi.FileLog; +import com.rusefi.binaryprotocol.BinaryProtocol; import com.rusefi.binaryprotocol.BinaryProtocolCommands; import com.rusefi.binaryprotocol.IncomingDataBuffer; import com.rusefi.config.generated.Fields; @@ -14,10 +15,11 @@ import java.util.concurrent.atomic.AtomicReference; import static com.rusefi.binaryprotocol.IoHelper.checkResponseCode; -class SerialAutoChecker implements Runnable { +public class SerialAutoChecker implements Runnable { private final String serialPort; private final CountDownLatch portFound; private final AtomicReference result; + public static String SIGNATURE; public SerialAutoChecker(String serialPort, CountDownLatch portFound, AtomicReference result) { this.serialPort = serialPort; @@ -29,17 +31,17 @@ class SerialAutoChecker implements Runnable { public void run() { IoStream stream = SerialIoStreamJSerialComm.openPort(serialPort); Logger logger = FileLog.LOGGER; - IncomingDataBuffer incomingData = new IncomingDataBuffer(logger); - stream.setInputListener(incomingData::addData); + IncomingDataBuffer incomingData = BinaryProtocol.createDataBuffer(stream, logger); try { stream.sendPacket(new byte[]{BinaryProtocolCommands.COMMAND_HELLO}, logger); - byte[] response = incomingData.getPacket(logger, "", false, System.currentTimeMillis()); + byte[] response = incomingData.getPacket(logger, "", false); if (!checkResponseCode(response, BinaryProtocolCommands.RESPONSE_OK)) return; - String message = new String(response, 1, response.length - 1); - System.out.println("Got " + message + " from " + serialPort); + String signature = new String(response, 1, response.length - 1); + SIGNATURE = signature; + System.out.println("Got " + signature + " from " + serialPort); String signatureWithoutMinorVersion = Fields.TS_SIGNATURE.substring(0, Fields.TS_SIGNATURE.length() - 2); - if (message.startsWith(signatureWithoutMinorVersion)) { + if (signature.startsWith(signatureWithoutMinorVersion)) { result.set(serialPort); portFound.countDown(); } diff --git a/java_console/ui/src/com/rusefi/tools/ConsoleTools.java b/java_console/ui/src/com/rusefi/tools/ConsoleTools.java index eedd96eef2..a9a91c8317 100644 --- a/java_console/ui/src/com/rusefi/tools/ConsoleTools.java +++ b/java_console/ui/src/com/rusefi/tools/ConsoleTools.java @@ -2,15 +2,17 @@ package com.rusefi.tools; import com.fathzer.soft.javaluator.DoubleEvaluator; import com.opensr5.ConfigurationImage; +import com.opensr5.Logger; import com.opensr5.io.ConfigurationImageFile; import com.rusefi.*; import com.rusefi.autodetect.PortDetector; +import com.rusefi.autodetect.SerialAutoChecker; import com.rusefi.binaryprotocol.BinaryProtocol; +import com.rusefi.binaryprotocol.IncomingDataBuffer; import com.rusefi.config.generated.Fields; -import com.rusefi.io.ConnectionStateListener; -import com.rusefi.io.ConnectionStatusLogic; -import com.rusefi.io.IoStream; -import com.rusefi.io.LinkManager; +import com.rusefi.core.EngineState; +import com.rusefi.core.ResponseBuffer; +import com.rusefi.io.*; import com.rusefi.io.serial.SerialIoStreamJSerialComm; import com.rusefi.maintenance.ExecHelper; import com.rusefi.tools.online.Online; @@ -20,67 +22,64 @@ import org.jetbrains.annotations.Nullable; import javax.xml.bind.JAXBException; import java.io.File; import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; import java.util.Arrays; import java.util.Map; -import java.util.Objects; import java.util.TreeMap; +import static com.rusefi.binaryprotocol.BinaryProtocol.sleep; +import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; + public class ConsoleTools { + public static final String SET_AUTH_TOKEN = "set_auth_token"; private static Map TOOLS = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); + private static Map toolsHelp = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); + static { - TOOLS.put("help", args -> printTools()); - TOOLS.put("headless", ConsoleTools::runHeadless); - TOOLS.put("compile", ConsoleTools::invokeCompileExpressionTool); - TOOLS.put("ptrace_enums", ConsoleTools::runPerfTraceTool); - TOOLS.put("save_binary_configuration", ConsoleTools::saveBinaryConfig); - TOOLS.put("functional_test", ConsoleTools::runFunctionalTest); - TOOLS.put("compile_fsio_file", ConsoleTools::runCompileTool); - TOOLS.put("firing_order", ConsoleTools::runFiringOrderTool); - TOOLS.put("convert_binary_configuration_to_xml", ConsoleTools::convertBinaryToXml); - TOOLS.put("reboot_ecu", args -> sendCommand(Fields.CMD_REBOOT)); - TOOLS.put(Fields.CMD_REBOOT_DFU, args -> sendCommand(Fields.CMD_REBOOT_DFU)); + registerTool("help", args -> printTools(), "Print this help."); + registerTool("headless", ConsoleTools::runHeadless, "Connect to rusEFI controller and start saving logs."); + + registerTool("ptrace_enums", ConsoleTools::runPerfTraceTool, "NOT A USER TOOL. Development tool to process pefrormance trace enums"); + registerTool("firing_order", ConsoleTools::runFiringOrderTool, "NOT A USER TOOL. Development tool relating to adding new firing order into rusEFI firmware."); + registerTool("functional_test", ConsoleTools::runFunctionalTest, "NOT A USER TOOL. Development tool related to functional testing"); + registerTool("convert_binary_configuration_to_xml", ConsoleTools::convertBinaryToXml, "NOT A USER TOOL. Development tool to convert binary configuration into XML form."); + + registerTool("compile_fsio_line", ConsoleTools::invokeCompileExpressionTool, "Convert a line to RPN form."); + registerTool("compile_fsio_file", ConsoleTools::runCompileTool, "Convert all lines from a file to RPN form."); + + registerTool("print_auth_token", args -> printAuthToken(), "Print current rusEFI Online authentication token."); + registerTool(SET_AUTH_TOKEN, ConsoleTools::setAuthToken, "Set rusEFI authentication token."); + registerTool("upload_tune", ConsoleTools::uploadTune, "Upload specified tune file using auth token from settings"); + + + registerTool("detect", ConsoleTools::detect, "Find attached rusEFI"); + registerTool("reboot_ecu", args -> sendCommand(Fields.CMD_REBOOT), "Sends a command to reboot rusEFI controller."); + registerTool(Fields.CMD_REBOOT_DFU, args -> sendCommand(Fields.CMD_REBOOT_DFU), "Sends a command to switch rusEFI controller into DFU mode."); + } + + private static void uploadTune(String[] args) throws IOException { + String fileName = args[1]; + String authToken = getConfig().getRoot().getProperty(Online.AUTH_TOKEN); + System.out.println("Trying to upload " + fileName + " using " + authToken); + Online.upload(new File(fileName), authToken); + } + + private static void registerTool(String command, ConsoleTool callback, String help) { + TOOLS.put(command, callback); + toolsHelp.put(command, help); } public static void printTools() { for (String key : TOOLS.keySet()) { System.out.println("Tool available: " + key); - } - } - - private static void saveBinaryConfig(String[] args) throws IOException { - if (args.length < 2) { - System.out.println("Please specify output file name for binary configuration"); - System.exit(-1); - } - String fileName = args[1]; - - String autoDetectedPort = autoDetectPort(); - if (autoDetectedPort == null) - return; - LinkManager.startAndConnect(autoDetectedPort, new ConnectionStateListener() { - @Override - public void onConnectionEstablished() { - BinaryProtocol binaryProtocol = LinkManager.connector.getBinaryProtocol(); - Objects.requireNonNull(binaryProtocol, "binaryProtocol"); - ConfigurationImage configurationImage = binaryProtocol.getControllerConfiguration(); - Objects.requireNonNull(configurationImage, "configurationImage"); - - try { - ConfigurationImageFile.saveToFile(configurationImage, fileName); - System.exit(0); - } catch (IOException e) { - System.out.println("While writing " + e); - System.exit(-1); - } + String help = toolsHelp.get(key); + if (help != null) { + System.out.println("\t" + help); + System.out.println("\n"); } - - @Override - public void onConnectionFailed() { - System.out.println("onConnectionFailed"); - System.exit(-1); - } - }); + } } private static void sendCommand(String command) throws IOException { @@ -106,6 +105,22 @@ public class ConsoleTools { System.exit(returnCode); } + private static void setAuthToken(String[] args) { + String newToken = args[1]; + System.out.println("Saving auth token " + newToken); + getConfig().getRoot().setProperty(Online.AUTH_TOKEN, newToken); + } + + private static void printAuthToken() { + String authToken = getConfig().getRoot().getProperty(Online.AUTH_TOKEN); + if (authToken.trim().isEmpty()) { + System.out.println("Auth token not defined. Please use " + SET_AUTH_TOKEN + " command"); + System.out.println("\tPlease see https://github.com/rusefi/rusefi/wiki/Online"); + return; + } + System.out.println("Auth token: " + authToken); + } + private static void runFunctionalTest(String[] args) throws InterruptedException { // passing port argument if it was specified String[] toolArgs = args.length == 1 ? new String[0] : new String[]{args[1]}; @@ -191,7 +206,7 @@ public class ConsoleTools { @Nullable private static String autoDetectPort() { - String autoDetectedPort = PortDetector.autoDetectPort(null); + String autoDetectedPort = PortDetector.autoDetectSerial(); if (autoDetectedPort == null) { System.err.println("rusEFI not detected"); return null; @@ -200,7 +215,6 @@ public class ConsoleTools { } private static void convertBinaryToXml(String[] args) throws IOException, JAXBException { - if (args.length < 2) { System.err.println("Binary file input expected"); System.exit(-1); @@ -211,7 +225,82 @@ public class ConsoleTools { Msq tune = Msq.toMsq(image); tune.writeXmlFile(Msq.outputXmlFileName); - Online.upload(new File(Msq.outputXmlFileName), "x"); + String authToken = getConfig().getRoot().getProperty(Online.AUTH_TOKEN); + System.out.println("Using " + authToken); + Online.upload(new File(Msq.outputXmlFileName), authToken); + } + + public static long classBuildTimeMillis() throws URISyntaxException, IllegalStateException, IllegalArgumentException { + Class clazz = ConsoleTools.class; + URL resource = clazz.getResource(clazz.getSimpleName() + ".class"); + if (resource == null) { + throw new IllegalStateException("Failed to find class file for class: " + + clazz.getName()); + } + + if (resource.getProtocol().equals("file")) { + return new File(resource.toURI()).lastModified(); + } else if (resource.getProtocol().equals("jar")) { + String path = resource.getPath(); + return new File(path.substring(5, path.indexOf("!"))).lastModified(); + } else { + throw new IllegalArgumentException("Unhandled url protocol: " + + resource.getProtocol() + " for class: " + + clazz.getName() + " resource: " + resource.toString()); + } + } + + static void detect(String[] strings) throws IOException, InterruptedException { + String autoDetectedPort = autoDetectPort(); + if (autoDetectedPort == null) { + System.out.println("rusEFI not detected"); + return; + } + IoStream stream = SerialIoStreamJSerialComm.openPort(autoDetectedPort); + Logger logger = FileLog.LOGGER; + IncomingDataBuffer incomingData = BinaryProtocol.createDataBuffer(stream, logger); + byte[] commandBytes = BinaryProtocol.getTextCommandBytes("hello"); + stream.sendPacket(commandBytes, logger); + // skipping response + incomingData.getPacket(logger, "", true); + + sleep(300); + stream.sendPacket(new byte[]{Fields.TS_GET_TEXT}, logger); + sleep(300); + + byte[] response = incomingData.getPacket(logger, "", true); + if (response == null) { + System.out.println("No response"); + return; + } + String textResponse = new String(response, 1, response.length - 1); + + StringBuilder messages = new StringBuilder(); + + ResponseBuffer responseBuffer = new ResponseBuffer(unpack -> { + EngineState.ValueCallback callback = new EngineState.ValueCallback() { + @Override + public void onUpdate(String value) { + if (value.startsWith(Fields.PROTOCOL_HELLO_PREFIX)) + messages.append(value + "\n"); + } + }; + while (!unpack.isEmpty()) { + String original = unpack; + unpack = EngineState.handleStringActionPair(unpack, new EngineState.StringActionPair(Fields.PROTOCOL_MSG, callback), null); + if (original.length() == unpack.length()) { + // skip key + unpack = EngineState.skipToken(unpack); + // skip value + unpack = EngineState.skipToken(unpack); + } + } + }); + responseBuffer.append(textResponse + "\r\n", LinkManager.ENCODER); + + System.out.println("Signature: " + SerialAutoChecker.SIGNATURE); + System.out.println("It says " + messages); + System.exit(0); } interface ConsoleTool { diff --git a/java_console/ui/src/com/rusefi/tools/online/Online.java b/java_console/ui/src/com/rusefi/tools/online/Online.java index fb4477f90a..0f21c6601a 100644 --- a/java_console/ui/src/com/rusefi/tools/online/Online.java +++ b/java_console/ui/src/com/rusefi/tools/online/Online.java @@ -13,6 +13,7 @@ import org.apache.http.util.EntityUtils; import java.io.*; public class Online { + public static final String AUTH_TOKEN = "auth_token"; private static final String url = "https://rusefi.com/online/upload.php"; public static void upload(File xmlFile, String authTokenValue) throws IOException { diff --git a/java_console/ui/src/com/rusefi/ui/OnlineTab.java b/java_console/ui/src/com/rusefi/ui/OnlineTab.java index b1cd9f1d6a..38b5bede46 100644 --- a/java_console/ui/src/com/rusefi/ui/OnlineTab.java +++ b/java_console/ui/src/com/rusefi/ui/OnlineTab.java @@ -17,7 +17,6 @@ import java.io.IOException; import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; public class OnlineTab { - private static final String AUTH_TOKEN = "auth_token"; private static final String TOKEN_WARNING = "Please copy token from your forum profile"; private final JPanel content = new JPanel(new VerticalFlowLayout()); @@ -26,7 +25,7 @@ public class OnlineTab { JTextField textField = new JTextField(); textField.setPreferredSize(new Dimension(200, 24)); - String authToken = getConfig().getRoot().getProperty(AUTH_TOKEN); + String authToken = getConfig().getRoot().getProperty(Online.AUTH_TOKEN); if (authToken.trim().isEmpty()) authToken = TOKEN_WARNING; @@ -40,7 +39,7 @@ public class OnlineTab { save.addActionListener(new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { - getConfig().getRoot().setProperty(AUTH_TOKEN, textField.getText()); + getConfig().getRoot().setProperty(Online.AUTH_TOKEN, textField.getText()); } }); content.add(save); diff --git a/java_console/ui/src/com/rusefi/ui/storage/Node.java b/java_console/ui/src/com/rusefi/ui/storage/Node.java index 2c8a9a7512..ad1e8a7dbb 100644 --- a/java_console/ui/src/com/rusefi/ui/storage/Node.java +++ b/java_console/ui/src/com/rusefi/ui/storage/Node.java @@ -6,6 +6,9 @@ import org.jetbrains.annotations.Nullable; import java.util.HashMap; import java.util.Map; +/** + * @see PersistentConfiguration + */ public class Node { private String prefix; private Map config = new HashMap<>(); diff --git a/java_console/ui/src/com/rusefi/ui/storage/PersistentConfiguration.java b/java_console/ui/src/com/rusefi/ui/storage/PersistentConfiguration.java index 2d8be05779..d6406c07f4 100644 --- a/java_console/ui/src/com/rusefi/ui/storage/PersistentConfiguration.java +++ b/java_console/ui/src/com/rusefi/ui/storage/PersistentConfiguration.java @@ -13,34 +13,50 @@ public class PersistentConfiguration { private static final String CONFIG_FILE_NAME = "rusefi_console_properties.xml"; private Map config = new HashMap<>(); + private boolean isLoaded; public static PersistentConfiguration getConfig() { return INSTANCE; } + private PersistentConfiguration() { + Runtime.getRuntime().addShutdownHook(new Thread(() -> getConfig().save())); + } + @SuppressWarnings("unchecked") public void load() { try { XMLDecoder e = new XMLDecoder(new BufferedInputStream(new FileInputStream(CONFIG_FILE_NAME))); config = (Map) e.readObject(); e.close(); + System.out.println("Got configuration from " + CONFIG_FILE_NAME); } catch (Throwable e) { FileLog.MAIN.logLine("Console configuration not found " + CONFIG_FILE_NAME + ", using defaults"); } + isLoaded = true; } + /** + * todo: maybe the shutdown hook is the only place where this method should be invoked? + */ public void save() { + if (!isLoaded) { + // settings not loaded, nothing to save + return; + } try { XMLEncoder e = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(CONFIG_FILE_NAME))); e.writeObject(config); e.close(); - System.out.println("Saved to " + CONFIG_FILE_NAME); + System.out.println("Saved settings to " + CONFIG_FILE_NAME); } catch (FileNotFoundException e1) { FileLog.MAIN.logLine("Error saving " + CONFIG_FILE_NAME); } } public Node getRoot() { + if (!isLoaded) + load(); return new Node("root", config); } } \ No newline at end of file diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index c14a88ab38..0684abf247 100644 Binary files a/java_tools/ConfigDefinition.jar and b/java_tools/ConfigDefinition.jar differ diff --git a/java_tools/configuration_definition/src/com/rusefi/VariableRegistry.java b/java_tools/configuration_definition/src/com/rusefi/VariableRegistry.java index 739251a759..305ee8f263 100644 --- a/java_tools/configuration_definition/src/com/rusefi/VariableRegistry.java +++ b/java_tools/configuration_definition/src/com/rusefi/VariableRegistry.java @@ -56,7 +56,7 @@ public class VariableRegistry { } value = applyVariables(value); int multPosition = value.indexOf(MULT_TOKEN); - if (multPosition != -1) { + if (!isQuoted(value, '"') && multPosition != -1) { Integer first = Integer.valueOf(value.substring(0, multPosition)); Integer second = Integer.valueOf(value.substring(multPosition + 1)); value = String.valueOf(first * second); diff --git a/java_tools/configuration_definition/src/com/rusefi/test/ConfigFieldParserTest.java b/java_tools/configuration_definition/src/com/rusefi/test/ConfigFieldParserTest.java index 89cfecb7f9..2164a5a51f 100644 --- a/java_tools/configuration_definition/src/com/rusefi/test/ConfigFieldParserTest.java +++ b/java_tools/configuration_definition/src/com/rusefi/test/ConfigFieldParserTest.java @@ -52,6 +52,17 @@ public class ConfigFieldParserTest { assertEquals(16, TypesHelper.getElementSize(state, "pid_s")); } + @Test + public void manyStartAreNotMultiplication() throws IOException { + String test = "struct pid_s\n" + + "#define ERROR_BUFFER_SIZE \"***\"\n" + + "end_struct\n" + + ""; + VariableRegistry.INSTANCE.clear(); + BufferedReader reader = new BufferedReader(new StringReader(test)); + new ReaderState().readBufferedReader(reader, Collections.emptyList()); + } + @Test public void multiplicationInDefine() throws IOException { String test = "struct pid_s\n" + diff --git a/java_tools/ts_plugin/.idea/encodings.xml b/java_tools/ts_plugin/.idea/encodings.xml new file mode 100644 index 0000000000..15a15b218a --- /dev/null +++ b/java_tools/ts_plugin/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/java_tools/ts_plugin/.idea/misc.xml b/java_tools/ts_plugin/.idea/misc.xml new file mode 100644 index 0000000000..05483570e0 --- /dev/null +++ b/java_tools/ts_plugin/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/java_tools/ts_plugin/.idea/modules.xml b/java_tools/ts_plugin/.idea/modules.xml new file mode 100644 index 0000000000..4a9e4920f3 --- /dev/null +++ b/java_tools/ts_plugin/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/java_tools/ts_plugin/.idea/vcs.xml b/java_tools/ts_plugin/.idea/vcs.xml new file mode 100644 index 0000000000..b2bdec2d71 --- /dev/null +++ b/java_tools/ts_plugin/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/java_tools/ts_plugin/lib/TunerStudioPluginAPI.jar b/java_tools/ts_plugin/lib/TunerStudioPluginAPI.jar new file mode 100644 index 0000000000..1c67767c7a Binary files /dev/null and b/java_tools/ts_plugin/lib/TunerStudioPluginAPI.jar differ diff --git a/java_tools/ts_plugin/ts_plugin.iml b/java_tools/ts_plugin/ts_plugin.iml new file mode 100644 index 0000000000..c90834f2d6 --- /dev/null +++ b/java_tools/ts_plugin/ts_plugin.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file