From 2db6ea36220113a1aa07b167e5d4b3fa00e4683b Mon Sep 17 00:00:00 2001 From: rusefillc Date: Mon, 20 Dec 2021 13:54:37 -0500 Subject: [PATCH] torque --- firmware/integration/rusefi_config.txt | 13 +++++++++++-- firmware/tunerstudio/rusefi.input | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 1578dde9ff..714398ad86 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -130,6 +130,7 @@ struct_no_prefix engine_configuration_s #define NARROW_BAND_WIDE_BAND_CONVERSION_SIZE 8 +#define TORQUE_CURVE_SIZE 8 #define CLT_CURVE_SIZE 16 #define CLT_LIMITER_CURVE_SIZE 4 #define CRANKING_CLT_IDLE_CURVE_SIZE 8 @@ -192,7 +193,10 @@ struct_no_prefix engine_configuration_s ! all the xxx_PACKING_xxx constants are about persisting tables in compact for, for example packing RPM with 50 increment in a byte ! or packing numeric voltage inside an integer byte ! See usages of '@@RPM_1_BYTE_PACKING_MULT@@' where we apply the TS part of the magic -! +! +! +! one byte RPM with '50' multiplier limits us at 12750 RPM which is below what small engines do +! in order for rusEFI to run on some F1 engines shall we move away from one byte RPM or bump multiplier to 100 or what? #define RPM_1_BYTE_PACKING_MULT 50 #define VOLTAGE_1_BYTE_PACKING_DIV 0.02 #define PERCENT_TRIM_BYTE_PACKING_DIV 0.02 @@ -1477,7 +1481,12 @@ int8_t[MAX_CYLINDER_COUNT iterate] fuelTrim;;"Percent", @@PERCENT_TRIM_BYTE_PACK uint16_t[HPFP_COMPENSATION_SIZE] autoscale hpfpCompensationLoadBins;;"cc/lobe", 0.001, 0, 0, 65, 3 uint8_t[HPFP_COMPENSATION_SIZE] autoscale hpfpCompensationRpmBins;;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0, 12500, 0 - int[429] mainUnusedEnd;;"units", 1, 0, -20, 100, 0 + uint8_t[TORQUE_CURVE_SIZE] torqueValues;;"Nm", 1, 0, 0, 255, 0 + uint16_t[TORQUE_CURVE_SIZE] torqueRpmBins;;"RPM", 1, 0, 0, 65000, 0 + + + + int[423] 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 3f90714f14..646d0c248f 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -311,6 +311,14 @@ enable2ndByteCanID = false yAxis = 0, 8, 10 xBins = knockNoiseRpmBins, RPMValue yBins = knockNoise + gauge = RPMGauge + + curve = torqueCurve, "Engine Torque" + columnLabel = "RPM", "Nm" + xAxis = 0, 8000, 9 + yAxis = 0, 8, 10 + xBins = torqueRpmBins, RPMValue + yBins = torqueValues gauge = RPMGauge curve = swKnockThresholdCurve, "Engine knock threshold RPM based" @@ -3433,6 +3441,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00" field = "turbo speed multiplier", turboSpeedSensorMultiplier field = "Artificial Misfire", artificialTestMisfire panel = allTriggerDebug + panel = torqueCurve help = helpGeneral, "rusEFI General Help" webHelp = @@MAIN_HELP_URL@@