From bb721e14a4ee37cfca3579b3d1957b089a8e6d2e Mon Sep 17 00:00:00 2001 From: rusefillc Date: Wed, 29 Sep 2021 23:46:30 -0400 Subject: [PATCH] individual cylinder fuel trims #3284 --- firmware/integration/rusefi_config.txt | 5 ++++- firmware/tunerstudio/rusefi.input | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 5584797c1c..369561420e 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -180,6 +180,7 @@ struct_no_prefix engine_configuration_s ! #define RPM_1_BYTE_PACKING_MULT 50 #define VOLTAGE_1_BYTE_PACKING_DIV 0.02 +#define PERCENT_TRIM_BYTE_PACKING_DIV 0.02 ! These are used currently only for output channels - but could be for config as well #define PACK_MULT_PRESSURE 30 @@ -1593,7 +1594,9 @@ tChargeMode_e tChargeMode; float[GAP_TRACKING_LENGTH iterate] triggerGapOverride;;"ratio", 1, 0, 0, 20, 2 - int[347] mainUnusedEnd;;"units", 1, 0, -20, 100, 0 +int8_t[MAX_CYLINDER_COUNT iterate] fuelTrim;;"Percent", PERCENT_TRIM_BYTE_PACKING_DIV, 0, -25, 25, 2 + + int[344] mainUnusedEnd;;"units", 1, 0, -20, 100, 0 ! end of engine_configuration_s end_struct diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 1b4db3ec3f..05ac1ede08 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1414,6 +1414,7 @@ menuDialog = main subMenu = injectionSettings, "Injection hardware", 0, {isInjectionEnabled == 1} subMenu = cylinderBankSelect, "Cylinder bank selection", 0, {isInjectionEnabled == 1} subMenu = injectorNonlinear, "Injector small-pulse correction", 0, {isInjectionEnabled == 1} + subMenu = fuelTrimSettings, "Fuel Trim", 0, {isInjectionEnabled == 1} subMenu = std_separator # Air mass model @@ -1938,6 +1939,20 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00" field = "Stoichiometric ratio", stoichRatioPrimary, {isInjectionEnabled == 1} field = "E100 stoichiometric ratio", stoichRatioSecondary, {isInjectionEnabled == 1 && flexSensorPin != 0 } + dialog = fuelTrimSettings, "Fuel Trim", yAxis + field = "Cylinder 1", fuelTrim1 + field = "Cylinder 2", fuelTrim2, {cylindersCount > 1} + field = "Cylinder 3", fuelTrim3, {cylindersCount > 2} + field = "Cylinder 4", fuelTrim4, {cylindersCount > 3} + field = "Cylinder 5", fuelTrim5, {cylindersCount > 4} + field = "Cylinder 6", fuelTrim6, {cylindersCount > 5} + field = "Cylinder 7", fuelTrim7, {cylindersCount > 6} + field = "Cylinder 8", fuelTrim8, {cylindersCount > 7} + field = "Cylinder 9", fuelTrim9, {cylindersCount > 8} + field = "Cylinder 10", fuelTrim10, {cylindersCount > 9} + field = "Cylinder 11", fuelTrim11, {cylindersCount > 10} + field = "Cylinder 12", fuelTrim12, {cylindersCount > 11} + dialog = injectorOutputSettings, "Injector Outputs", yAxis field = "Use only first half of pins for batch mode" field = "Injection Pin 1", injectionPins1, {isInjectionEnabled == 1}