From 837492c9f0d8ee7451abcd094a9c482ec0d1eede Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 10 Jun 2019 23:38:44 -0400 Subject: [PATCH] ETB: TPS should be f(RPM, pedal) #835 --- .../actuators/electronic_throttle.cpp | 3 +++ .../engine_configuration_generated_structures.h | 8 ++++---- firmware/controllers/algo/rusefi_generated.h | 8 ++++---- firmware/integration/rusefi_config.txt | 5 +++-- firmware/tunerstudio/rusefi.ini | 17 ++++++++++++++--- firmware/tunerstudio/rusefi.input | 11 +++++++++++ firmware/tunerstudio/rusefi_frankenso.ini | 17 ++++++++++++++--- firmware/tunerstudio/rusefi_microrusefi.ini | 17 ++++++++++++++--- firmware/tunerstudio/rusefi_prometheus.ini | 16 +++++++++++++--- .../models/src/com/rusefi/config/Fields.java | 10 +++++----- 10 files changed, 85 insertions(+), 27 deletions(-) diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index 23f58eb5b8..eb1ab12251 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -332,6 +332,9 @@ void setEtbOffset(int value) { } void setDefaultEtbParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) { + setLinearCurveAny(config->pedalToTpsTpsBins, PEDAL_TO_TPS_SIZE, /*from*/0, /*to*/100, 1); + setLinearCurveAny(config->pedalToTpsRpmBins, PEDAL_TO_TPS_SIZE, /*from*/0, /*to*/8000 / 50, 1); + engineConfiguration->throttlePedalUpVoltage = 0; // that's voltage, not ADC like with TPS engineConfiguration->throttlePedalWOTVoltage = 6; // that's voltage, not ADC like with TPS diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 106d5fa96d..3f0a942086 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 13:04:10 EDT 2019 +// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 23:09:10 EDT 2019 // begin #ifndef CONTROLLERS_ALGO_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H #define CONTROLLERS_ALGO_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H @@ -2556,11 +2556,11 @@ struct persistent_config_s { /** * offset 6464 */ - uint8_t pedalToTpsBins[PEDAL_TO_TPS_SIZE]; + int8_t pedalToTpsTpsBins[PEDAL_TO_TPS_SIZE]; /** * offset 6472 */ - uint8_t pedalToTps[PEDAL_TO_TPS_SIZE]; + uint8_t pedalToTpsRpmBins[PEDAL_TO_TPS_SIZE]; /** * CLT-based cranking position multiplier for simple manual idle controller * offset 6480 @@ -2800,4 +2800,4 @@ typedef struct persistent_config_s persistent_config_s; #endif // end -// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 13:04:10 EDT 2019 +// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 23:09:10 EDT 2019 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 80d69a16a2..9149b237f0 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -1476,12 +1476,12 @@ #define pauseEtbControl_offset 744 #define pauseEtbControl_offset_hex 2e8 #define PEDAL_TO_TPS_SIZE 8 -#define pedalToTps_offset 6472 -#define pedalToTps_offset_hex 1948 -#define pedalToTpsBins_offset 6464 -#define pedalToTpsBins_offset_hex 1940 +#define pedalToTpsRpmBins_offset 6472 +#define pedalToTpsRpmBins_offset_hex 1948 #define pedalToTpsTable_offset 6400 #define pedalToTpsTable_offset_hex 1900 +#define pedalToTpsTpsBins_offset 6464 +#define pedalToTpsTpsBins_offset_hex 1940 #define pidExtraForLowRpm_offset 3180 #define pidExtraForLowRpm_offset_hex c6c #define pin_mode_e_enum "default", "INVALID", "INVALID", "INVALID", "opendrain", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PULLUP", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PULLDOWN" diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index b66ac5d9cb..da1c1d27b6 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -1061,8 +1061,9 @@ end_struct engine_configuration_s engineConfiguration; pedal_to_tps_t pedalToTpsTable; -uint8_t[PEDAL_TO_TPS_SIZE] pedalToTpsBins;;"%", 1, 0, 0.0, 120.0, 0 -uint8_t[PEDAL_TO_TPS_SIZE] pedalToTps;;"%", 1, 0, 0.0, 120.0, 0 +int8_t[PEDAL_TO_TPS_SIZE] pedalToTpsTpsBins;;"%", 1, 0, 0.0, 120.0, 0 +! it's not serious to use one byte for RPM but let me try that just to try it +uint8_t[PEDAL_TO_TPS_SIZE] pedalToTpsRpmBins;;"RPM", 50, 0, 0.0, 12000.0, 0 float[CLT_CRANKING_CURVE_SIZE] cltCrankingCorrBins;CLT-based cranking position multiplier for simple manual idle controller;"C", 1, 0, -100.0, 250.0, 2 float[CLT_CRANKING_CURVE_SIZE] cltCrankingCorr ;CLT-based cranking position multiplier for simple manual idle controller;"%", 1, 0, 0.0, 500.0, 2 diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 15f72c1473..50aa134472 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -72,7 +72,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 13:04:10 EDT 2019 +; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 23:09:10 EDT 2019 pageSize = 20000 page = 1 @@ -878,8 +878,8 @@ page = 1 ;no TS info - skipping unusedSpiPadding8 offset 4033 ;no TS info - skipping mainUnusedEnd offset 4036 pedalToTpsTable = array, U08, 6400, [8x8],"deg", 1, 0, -720, 720, 2 - pedalToTpsBins = array, U08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0 - pedalToTps = array, U08, 6472, [8], "%", 1, 0, 0.0, 120.0, 0 + pedalToTpsTpsBins = array, S08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0 + pedalToTpsRpmBins = array, U08, 6472, [8], "RPM", 50, 0, 0.0, 12000.0, 0 cltCrankingCorrBins = array, F32, 6480, [8], "C", 1, 0, -100.0, 250.0, 2 cltCrankingCorr = array, F32, 6512, [8], "%", 1, 0, 0.0, 500.0, 2 idleAdvanceBins = array, F32, 6544, [8], "RPM", 1, 0, 0.0, 18000, 2 @@ -1653,6 +1653,16 @@ fileVersion = { 20171101 } gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. upDownLabel = "(Later)", "(Sooner)" + table = pedalToTpsTbl, pedalToTpsMap, "ETB Pedal to TPS", 1 + ; constant, variable + xBins = pedalToTpsRpmBins, RPMValue + yBins = pedalToTpsTpsBins, TPSValue + zBins = pedalToTpsTable +; gridHeight = 2.0 + gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. + upDownLabel = "(Later)", "(Sooner)" + + table = afrTableTbl, afrTableMap, "Target AFR Table", 1 ; constant, variable xBins = afrRpmBins, RPMValue @@ -2166,6 +2176,7 @@ menuDialog = main subMenu = etbDialog, "Electronic throttle body (beta version)" subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" + subMenu = pedalToTpsTbl, "Electronic Pedal Map" [ControllerCommands] diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index c14ef7a559..db45e1227f 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -716,6 +716,16 @@ fileVersion = { 20171101 } gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. upDownLabel = "(Later)", "(Sooner)" + table = pedalToTpsTbl, pedalToTpsMap, "ETB Pedal to TPS", 1 + ; constant, variable + xBins = pedalToTpsRpmBins, RPMValue + yBins = pedalToTpsTpsBins, TPSValue + zBins = pedalToTpsTable +; gridHeight = 2.0 + gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. + upDownLabel = "(Later)", "(Sooner)" + + table = afrTableTbl, afrTableMap, "Target AFR Table", 1 ; constant, variable xBins = afrRpmBins, RPMValue @@ -1229,6 +1239,7 @@ menuDialog = main subMenu = etbDialog, "Electronic throttle body (beta version)" @@if_ts_show_etb subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" @@if_ts_show_etb + subMenu = pedalToTpsTbl, "Electronic Pedal Map" @@if_ts_show_etb [ControllerCommands] diff --git a/firmware/tunerstudio/rusefi_frankenso.ini b/firmware/tunerstudio/rusefi_frankenso.ini index ccfd087f41..c68575e573 100644 --- a/firmware/tunerstudio/rusefi_frankenso.ini +++ b/firmware/tunerstudio/rusefi_frankenso.ini @@ -72,7 +72,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 13:04:21 EDT 2019 +; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 23:09:15 EDT 2019 pageSize = 20000 page = 1 @@ -878,8 +878,8 @@ page = 1 ;no TS info - skipping unusedSpiPadding8 offset 4033 ;no TS info - skipping mainUnusedEnd offset 4036 pedalToTpsTable = array, U08, 6400, [8x8],"deg", 1, 0, -720, 720, 2 - pedalToTpsBins = array, U08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0 - pedalToTps = array, U08, 6472, [8], "%", 1, 0, 0.0, 120.0, 0 + pedalToTpsTpsBins = array, S08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0 + pedalToTpsRpmBins = array, U08, 6472, [8], "RPM", 50, 0, 0.0, 12000.0, 0 cltCrankingCorrBins = array, F32, 6480, [8], "C", 1, 0, -100.0, 250.0, 2 cltCrankingCorr = array, F32, 6512, [8], "%", 1, 0, 0.0, 500.0, 2 idleAdvanceBins = array, F32, 6544, [8], "RPM", 1, 0, 0.0, 18000, 2 @@ -1653,6 +1653,16 @@ fileVersion = { 20171101 } gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. upDownLabel = "(Later)", "(Sooner)" + table = pedalToTpsTbl, pedalToTpsMap, "ETB Pedal to TPS", 1 + ; constant, variable + xBins = pedalToTpsRpmBins, RPMValue + yBins = pedalToTpsTpsBins, TPSValue + zBins = pedalToTpsTable +; gridHeight = 2.0 + gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. + upDownLabel = "(Later)", "(Sooner)" + + table = afrTableTbl, afrTableMap, "Target AFR Table", 1 ; constant, variable xBins = afrRpmBins, RPMValue @@ -2166,6 +2176,7 @@ menuDialog = main subMenu = etbDialog, "Electronic throttle body (beta version)" subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" + subMenu = pedalToTpsTbl, "Electronic Pedal Map" [ControllerCommands] diff --git a/firmware/tunerstudio/rusefi_microrusefi.ini b/firmware/tunerstudio/rusefi_microrusefi.ini index 69b2e0bcfb..f0c1ae9867 100644 --- a/firmware/tunerstudio/rusefi_microrusefi.ini +++ b/firmware/tunerstudio/rusefi_microrusefi.ini @@ -72,7 +72,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 13:04:16 EDT 2019 +; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 23:09:13 EDT 2019 pageSize = 20000 page = 1 @@ -878,8 +878,8 @@ page = 1 ;no TS info - skipping unusedSpiPadding8 offset 4033 ;no TS info - skipping mainUnusedEnd offset 4036 pedalToTpsTable = array, U08, 6400, [8x8],"deg", 1, 0, -720, 720, 2 - pedalToTpsBins = array, U08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0 - pedalToTps = array, U08, 6472, [8], "%", 1, 0, 0.0, 120.0, 0 + pedalToTpsTpsBins = array, S08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0 + pedalToTpsRpmBins = array, U08, 6472, [8], "RPM", 50, 0, 0.0, 12000.0, 0 cltCrankingCorrBins = array, F32, 6480, [8], "C", 1, 0, -100.0, 250.0, 2 cltCrankingCorr = array, F32, 6512, [8], "%", 1, 0, 0.0, 500.0, 2 idleAdvanceBins = array, F32, 6544, [8], "RPM", 1, 0, 0.0, 18000, 2 @@ -1653,6 +1653,16 @@ fileVersion = { 20171101 } gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. upDownLabel = "(Later)", "(Sooner)" + table = pedalToTpsTbl, pedalToTpsMap, "ETB Pedal to TPS", 1 + ; constant, variable + xBins = pedalToTpsRpmBins, RPMValue + yBins = pedalToTpsTpsBins, TPSValue + zBins = pedalToTpsTable +; gridHeight = 2.0 + gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. + upDownLabel = "(Later)", "(Sooner)" + + table = afrTableTbl, afrTableMap, "Target AFR Table", 1 ; constant, variable xBins = afrRpmBins, RPMValue @@ -2159,6 +2169,7 @@ menuDialog = main subMenu = etbDialog, "Electronic throttle body (beta version)" subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" + subMenu = pedalToTpsTbl, "Electronic Pedal Map" [ControllerCommands] diff --git a/firmware/tunerstudio/rusefi_prometheus.ini b/firmware/tunerstudio/rusefi_prometheus.ini index 585d01a77f..94da322ddd 100644 --- a/firmware/tunerstudio/rusefi_prometheus.ini +++ b/firmware/tunerstudio/rusefi_prometheus.ini @@ -72,7 +72,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 13:04:25 EDT 2019 +; this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 23:09:17 EDT 2019 pageSize = 20000 page = 1 @@ -878,8 +878,8 @@ page = 1 ;no TS info - skipping unusedSpiPadding8 offset 4033 ;no TS info - skipping mainUnusedEnd offset 4036 pedalToTpsTable = array, U08, 6400, [8x8],"deg", 1, 0, -720, 720, 2 - pedalToTpsBins = array, U08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0 - pedalToTps = array, U08, 6472, [8], "%", 1, 0, 0.0, 120.0, 0 + pedalToTpsTpsBins = array, S08, 6464, [8], "%", 1, 0, 0.0, 120.0, 0 + pedalToTpsRpmBins = array, U08, 6472, [8], "RPM", 50, 0, 0.0, 12000.0, 0 cltCrankingCorrBins = array, F32, 6480, [8], "C", 1, 0, -100.0, 250.0, 2 cltCrankingCorr = array, F32, 6512, [8], "%", 1, 0, 0.0, 500.0, 2 idleAdvanceBins = array, F32, 6544, [8], "RPM", 1, 0, 0.0, 18000, 2 @@ -1653,6 +1653,16 @@ fileVersion = { 20171101 } gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. upDownLabel = "(Later)", "(Sooner)" + table = pedalToTpsTbl, pedalToTpsMap, "ETB Pedal to TPS", 1 + ; constant, variable + xBins = pedalToTpsRpmBins, RPMValue + yBins = pedalToTpsTpsBins, TPSValue + zBins = pedalToTpsTable +; gridHeight = 2.0 + gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. + upDownLabel = "(Later)", "(Sooner)" + + table = afrTableTbl, afrTableMap, "Target AFR Table", 1 ; constant, variable xBins = afrRpmBins, RPMValue diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 4ec951058b..65ef441fb5 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config; -// this file was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 13:04:10 EDT 2019 +// this file was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 23:08:07 EDT 2019 public class Fields { public static final int accelerometerSpiDevice_offset = 2736; public static final int acCutoffHighRpm_offset = 1498; @@ -960,12 +960,12 @@ public class Fields { public static final int overrideCrankingIgnition_offset_hex = 204; public static final int pauseEtbControl_offset = 744; public static final int PEDAL_TO_TPS_SIZE = 8; - public static final int pedalToTps_offset = 6472; - public static final int pedalToTps_offset_hex = 1948; - public static final int pedalToTpsBins_offset = 6464; - public static final int pedalToTpsBins_offset_hex = 1940; + public static final int pedalToTpsRpmBins_offset = 6472; + public static final int pedalToTpsRpmBins_offset_hex = 1948; public static final int pedalToTpsTable_offset = 6400; public static final int pedalToTpsTable_offset_hex = 1900; + public static final int pedalToTpsTpsBins_offset = 6464; + public static final int pedalToTpsTpsBins_offset_hex = 1940; public static final int pidExtraForLowRpm_offset = 3180; public static final int postCrankingDurationSec_offset = 2464; public static final int postCrankingFactor_offset = 2460;