diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 4ea6b437e6..73c05f1458 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -404,7 +404,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { boardConfiguration->idle.stepperDirectionPin = GPIOE_10; boardConfiguration->idle.stepperStepPin = GPIOE_12; - engineConfiguration->accelLength = 12; + engineConfiguration->mapAccelLength = 12; } #endif /* EFI_SUPPORT_DODGE_NEON */ diff --git a/firmware/config/engines/gm_2_2.cpp b/firmware/config/engines/gm_2_2.cpp index 2fa034ce41..66f2889a63 100644 --- a/firmware/config/engines/gm_2_2.cpp +++ b/firmware/config/engines/gm_2_2.cpp @@ -10,11 +10,15 @@ #include "global.h" #include "gm_2_2.h" -EXTERN_ENGINE; +EXTERN_ENGINE +; void setGm2_2(DECLARE_ENGINE_PARAMETER_F) { board_configuration_s * boardConfiguration = &engineConfiguration->bc; + setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR); + engineConfiguration->trigger.type = TT_ONE_PLUS_TOOTHED_WHEEL_60_2; + boardConfiguration->triggerInputPins[0] = GPIOC_6; boardConfiguration->triggerInputPins[1] = GPIOA_8; diff --git a/firmware/console/binary/tunerstudio_configuration.h b/firmware/console/binary/tunerstudio_configuration.h index 358984bec8..22f5456098 100644 --- a/firmware/console/binary/tunerstudio_configuration.h +++ b/firmware/console/binary/tunerstudio_configuration.h @@ -91,8 +91,9 @@ typedef struct { float veValue; float maxDelta; float minDelta; - float currentAccelDelta; - int unused3[17]; + float currentMapAccelDelta; + float tpsAccelFuel; + int unused3[16]; } TunerStudioOutputChannels; #endif /* TUNERSTUDIO_CONFIGURATION_H_ */ diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index f249b2cd16..b87febd8de 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -558,7 +558,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->rpmAcceleration = engine->rpmCalculator.getRpmAcceleration(); tsOutputChannels->maxDelta = engine->accelEnrichment.maxDelta; tsOutputChannels->minDelta = engine->accelEnrichment.minDelta; - tsOutputChannels->currentAccelDelta = engine->accelEnrichment.getEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap(); + tsOutputChannels->currentMapAccelDelta = engine->accelEnrichment.getEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap(); tsOutputChannels->checkEngine = hasErrorCodes(); #if EFI_PROD_CODE || defined(__DOXYGEN__) diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index 220ea74b5e..43c34c5ab5 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -21,7 +21,8 @@ EXTERN_ENGINE //static THD_WORKING_AREA(aeThreadStack, UTILITY_THREAD_STACK_SIZE); //#endif -static AccelEnrichmemnt instance; +static AccelEnrichmemnt mapInstance; +static AccelEnrichmemnt tpsInstance; static Logging *logger; void AccelEnrichmemnt::updateDiffEnrichment(engine_configuration_s *engineConfiguration, float engineLoad) { @@ -40,8 +41,8 @@ void AccelEnrichmemnt::updateDiffEnrichment(engine_configuration_s *engineConfig float AccelEnrichmemnt::getEnrichment(DECLARE_ENGINE_PARAMETER_F) { float d = cb.maxValue(cb.getSize()); - if (d > engineConfiguration->accelEnrichmentThreshold) { - return d * engineConfiguration->accelEnrichmentMultiplier; + if (d > engineConfiguration->mapAccelEnrichmentThreshold) { + return d * engineConfiguration->mapAccelEnrichmentMultiplier; } // if (d < engineConfiguration->deaccelEnrichmentThreshold) { // return d * engineConfiguration->deaccelEnrichmentMultiplier; @@ -104,18 +105,31 @@ AccelEnrichmemnt::AccelEnrichmemnt() { #if ! EFI_UNIT_TEST || defined(__DOXYGEN__) static void accelInfo() { - scheduleMsg(logger, "accel length=%d", instance.cb.getSize()); - scheduleMsg(logger, "accel th=%f/mult=%f", engineConfiguration->accelEnrichmentThreshold, engineConfiguration->accelEnrichmentMultiplier); - scheduleMsg(logger, "decel th=%f/mult=%f", engineConfiguration->decelEnrichmentThreshold, engineConfiguration->decelEnrichmentMultiplier); + scheduleMsg(logger, "MAP accel length=%d", mapInstance.cb.getSize()); + scheduleMsg(logger, "MAP accel th=%f/mult=%f", engineConfiguration->mapAccelEnrichmentThreshold, engineConfiguration->mapAccelEnrichmentMultiplier); + scheduleMsg(logger, "MAP decel th=%f/mult=%f", engineConfiguration->decelEnrichmentThreshold, engineConfiguration->decelEnrichmentMultiplier); + + scheduleMsg(logger, "TPS accel length=%d", tpsInstance.cb.getSize()); + scheduleMsg(logger, "TPS accel th=%f/mult=%f", engineConfiguration->tpsAccelEnrichmentThreshold, engineConfiguration->tpsAccelEnrichmentMultiplier); } -static void setAccelThr(float value) { - engineConfiguration->accelEnrichmentThreshold = value; +static void setMapAccelThr(float value) { + engineConfiguration->mapAccelEnrichmentThreshold = value; accelInfo(); } -static void setAccelMult(float value) { - engineConfiguration->accelEnrichmentMultiplier = value; +static void setMapAccelMult(float value) { + engineConfiguration->mapAccelEnrichmentMultiplier = value; + accelInfo(); +} + +static void setTpsAccelThr(float value) { + engineConfiguration->tpsAccelEnrichmentThreshold = value; + accelInfo(); +} + +static void setTpsAccelMult(float value) { + engineConfiguration->tpsAccelEnrichmentMultiplier = value; accelInfo(); } @@ -129,20 +143,30 @@ static void setDecelMult(float value) { accelInfo(); } -static void setAccelLen(int len) { - instance.cb.setSize(len); +static void setTpsAccelLen(int len) { + tpsInstance.cb.setSize(len); + accelInfo(); +} + +static void setMapAccelLen(int len) { + mapInstance.cb.setSize(len); accelInfo(); } void initAccelEnrichment(Logging *sharedLogger) { logger = sharedLogger; - addConsoleActionF("set_accel_threshold", setAccelThr); - addConsoleActionF("set_accel_multiplier", setAccelMult); + addConsoleActionI("set_tps_accel_len", setTpsAccelLen); + addConsoleActionF("set_tps_accel_threshold", setTpsAccelThr); + addConsoleActionF("set_tps_ccel_multiplier", setTpsAccelMult); + + addConsoleActionI("set_map_accel_len", setMapAccelLen); + addConsoleActionF("set_map_accel_threshold", setMapAccelThr); + addConsoleActionF("set_map_ccel_multiplier", setMapAccelMult); addConsoleActionF("set_decel_threshold", setDecelThr); addConsoleActionF("set_decel_multiplier", setDecelMult); - addConsoleActionI("set_accel_len", setAccelLen); addConsoleAction("accelinfo", accelInfo); - setAccelLen(engineConfiguration->accelLength); + setMapAccelLen(engineConfiguration->mapAccelLength); + setTpsAccelLen(engineConfiguration->tpsAccelLength); } #endif /* ! EFI_UNIT_TEST */ diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 949bc9846d..1d0edaef0e 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -593,9 +593,9 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { boardConfiguration->idle.stepperStepPin = GPIO_UNASSIGNED; boardConfiguration->idle.stepperDirectionPin = GPIO_UNASSIGNED; - engineConfiguration->accelLength = 6; - engineConfiguration->accelEnrichmentThreshold = 5; // kPa - engineConfiguration->accelEnrichmentMultiplier = 2; + engineConfiguration->mapAccelLength = 6; + engineConfiguration->mapAccelEnrichmentThreshold = 5; // kPa + engineConfiguration->mapAccelEnrichmentMultiplier = 2; } void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_S) { diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index afa8344083..a59eb33173 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 by config_definition.jar on Wed Apr 08 21:53:21 EDT 2015 +// this section was generated by config_definition.jar on Fri Apr 10 23:17:12 EDT 2015 // begin #include "rusefi_types.h" typedef struct { @@ -1087,11 +1087,23 @@ typedef struct { /** * offset 1636 */ - int unused3[140]; + int unused3[137]; + /** + * offset 2184 + */ + int tpsAccelLength; + /** + * offset 2188 + */ + float tpsAccelEnrichmentThreshold; + /** + * offset 2192 + */ + float tpsAccelEnrichmentMultiplier; /** * offset 2196 */ - int accelLength; + int mapAccelLength; /** * offset 2200 */ @@ -1103,11 +1115,11 @@ typedef struct { /** * offset 2208 */ - float accelEnrichmentThreshold; + float mapAccelEnrichmentThreshold; /** * offset 2212 */ - float accelEnrichmentMultiplier; + float mapAccelEnrichmentMultiplier; /** total size 2216*/ } engine_configuration_s; @@ -1255,4 +1267,4 @@ typedef struct { } persistent_config_s; // end -// this section was generated by config_definition.jar on Wed Apr 08 21:53:21 EDT 2015 +// this section was generated by config_definition.jar on Fri Apr 10 23:17:12 EDT 2015 diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index dcd168d8ec..67b567e748 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -483,14 +483,18 @@ custom pin_input_mode_e 4 scalar, F32, @OFFSET@, "ms", 1, 0, 0, 200, 1 float alternatorControlPFactor; float alternatorControlIFactor; float alternatorControlDFactor; - int[140] unused3; + int[137] unused3; + + int tpsAccelLength;;"len", 1, 0, 0, 200, 3 + float tpsAccelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3 + float tpsAccelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3 - int accelLength;;"len", 1, 0, 0, 200, 3 + int mapAccelLength;;"len", 1, 0, 0, 200, 3 float decelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3 float decelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3 - float accelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3 - float accelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3 + float mapAccelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3 + float mapAccelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3 end_struct diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index b406d142bc..52e29fe1cd 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -40,7 +40,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated by ConfigDefinition.jar on Wed Apr 08 21:53:24 EDT 2015 +; this section was generated by ConfigDefinition.jar on Fri Apr 10 23:17:14 EDT 2015 pageSize = 15288 page = 1 @@ -451,11 +451,14 @@ page = 1 ;skipping alternatorControlIFactor offset 1628 ;skipping alternatorControlDFactor offset 1632 ;skipping unused3 offset 1636 - accelLength = scalar, S32, 2196, "len", 1, 0, 0, 200, 3 + tpsAccelLength = scalar, S32, 2184, "len", 1, 0, 0, 200, 3 + tpsAccelEnrichmentThreshold = scalar, F32, 2188, "roc", 1, 0, 0, 200, 3 + tpsAccelEnrichmentMultiplier = scalar, F32, 2192, "coeff", 1, 0, 0, 200, 3 + mapAccelLength = scalar, S32, 2196, "len", 1, 0, 0, 200, 3 decelEnrichmentThreshold = scalar, F32, 2200, "roc", 1, 0, 0, 200, 3 decelEnrichmentMultiplier = scalar, F32, 2204, "coeff", 1, 0, 0, 200, 3 - accelEnrichmentThreshold = scalar, F32, 2208, "roc", 1, 0, 0, 200, 3 - accelEnrichmentMultiplier = scalar, F32, 2212, "coeff", 1, 0, 0, 200, 3 + mapAccelEnrichmentThreshold = scalar, F32, 2208, "roc", 1, 0, 0, 200, 3 + mapAccelEnrichmentMultiplier = scalar, F32, 2212, "coeff", 1, 0, 0, 200, 3 le_formulas1 = array, U08, 2216, [200],"char", 1, 0, 0.0, 3.0, 2 le_formulas2 = array, U08, 2416, [200],"char", 1, 0, 0.0, 3.0, 2 le_formulas3 = array, U08, 2616, [200],"char", 1, 0, 0.0, 3.0, 2 @@ -944,9 +947,12 @@ fileVersion = { 20150406 } field = "Timing Mode", timingMode field = "" field = "Global fuel correction", globalFuelCorrection - field = "accel length", accelLength - field = "Accel threshold", accelEnrichmentThreshold - field = "Accel Mult", accelEnrichmentMultiplier + field = "MAP accel length", mapAccelLength + field = "MAP Accel threshold", mapAccelEnrichmentThreshold + field = "MAP Accel Mult", mapAaccelEnrichmentMultiplier + field = "TPS accel length", tpsAccelLength + field = "TPS Accel threshold", tpsAccelEnrichmentThreshold + field = "TPS Accel Mult", tpsAaccelEnrichmentMultiplier ; Engine->Trigger configuration dialog = triggerConfiguration, "Trigger configuration"