From 5d9c680cd364d708cee12bbb8e38a1fa6b5cc03c Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 31 Dec 2015 13:02:19 -0500 Subject: [PATCH] auto-sync --- firmware/config/engines/dodge_neon.cpp | 6 ++-- firmware/config/engines/honda_accord.cpp | 7 ++-- firmware/config/engines/mazda_626.cpp | 6 ++-- .../binary/tunerstudio_configuration.h | 2 +- firmware/console/eficonsole.cpp | 20 +++++------ firmware/console/status_loop.cpp | 2 +- .../controllers/algo/accel_enrichment.cpp | 26 +++++++------- firmware/controllers/algo/advance_map.cpp | 34 +++++++++++++++++++ firmware/controllers/algo/advance_map.h | 2 ++ firmware/controllers/algo/engine.h | 2 +- ...ngine_configuration_generated_structures.h | 10 +++--- firmware/controllers/algo/rusefi_generated.h | 8 ++--- .../trigger/main_trigger_callback.cpp | 2 +- firmware/integration/rusefi_config.txt | 6 ++-- firmware/tunerstudio/rusefi.ini | 20 +++++------ .../models/src/com/rusefi/config/Fields.java | 8 ++--- unit_tests/main.cpp | 8 ++--- unit_tests/test_engine_math.cpp | 2 ++ 18 files changed, 105 insertions(+), 66 deletions(-) diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 7c6192c1a5..67c19b6974 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -431,9 +431,9 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->canNbcType = CAN_BUS_NBC_BMW; // engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8; - engineConfiguration->mapAccelLength = 12; - engineConfiguration->mapAccelEnrichmentThreshold = 5; // kPa - engineConfiguration->mapAccelEnrichmentMultiplier = 0; + engineConfiguration->engineLoadAccelLength = 12; + engineConfiguration->engineLoadAccelEnrichmentThreshold = 5; // kPa + engineConfiguration->engineLoadAccelEnrichmentMultiplier = 0; engineConfiguration->tpsAccelLength = 12; engineConfiguration->tpsAccelEnrichmentThreshold = 10; diff --git a/firmware/config/engines/honda_accord.cpp b/firmware/config/engines/honda_accord.cpp index 1a8395672a..bad7cf0b8c 100644 --- a/firmware/config/engines/honda_accord.cpp +++ b/firmware/config/engines/honda_accord.cpp @@ -24,6 +24,7 @@ #include "honda_accord.h" #include "engine_math.h" #include "settings.h" +#include "advance_map.h" void setFrankenso_01_LCD(board_configuration_s *boardConfiguration) { boardConfiguration->HD44780_rs = GPIOE_7; @@ -53,11 +54,11 @@ static void setHondaAccordConfigurationCommon(DECLARE_ENGINE_PARAMETER_F) { // Keihin 06164-P0A-A00 engineConfiguration->injector.flow = 248; -// engineConfiguration->algorithm = LM_SPEED_DENSITY; - // I want to start with a simple Alpha-N - setAlgorithm(LM_ALPHA_N PASS_ENGINE_PARAMETER); + setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER); setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER); + buildTimingMap(35 PASS_ENGINE_PARAMETER); + /** * 18K Ohm @ -20C * 2.1K Ohm @ 24C diff --git a/firmware/config/engines/mazda_626.cpp b/firmware/config/engines/mazda_626.cpp index 257ddfb334..f4a174d30c 100644 --- a/firmware/config/engines/mazda_626.cpp +++ b/firmware/config/engines/mazda_626.cpp @@ -79,9 +79,9 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->map.sensor.type = MT_SUBY_DENSO; // http://s2.micp.ru/vJ9Sd.png - engineConfiguration->mapAccelLength = 12; - engineConfiguration->mapAccelEnrichmentThreshold = 1; - engineConfiguration->mapAccelEnrichmentMultiplier = 0.25; + engineConfiguration->engineLoadAccelLength = 12; + engineConfiguration->engineLoadAccelEnrichmentThreshold = 1; + engineConfiguration->engineLoadAccelEnrichmentMultiplier = 0.25; engineConfiguration->tpsAccelLength = 12; engineConfiguration->tpsAccelEnrichmentThreshold = 10; diff --git a/firmware/console/binary/tunerstudio_configuration.h b/firmware/console/binary/tunerstudio_configuration.h index 5692e7dea4..f2b328d9eb 100644 --- a/firmware/console/binary/tunerstudio_configuration.h +++ b/firmware/console/binary/tunerstudio_configuration.h @@ -88,7 +88,7 @@ typedef struct { float veValue; // current volumetric efficiency, offset 112 float deltaTps; int triggerErrorsCounter; - float currentMapAccelDelta; + float currentEngineLoadAccelDelta; float tpsAccelFuel; // offset 128 float baroCorrection; float pedalPosition; diff --git a/firmware/console/eficonsole.cpp b/firmware/console/eficonsole.cpp index 115823ea6d..d43e4c3068 100644 --- a/firmware/console/eficonsole.cpp +++ b/firmware/console/eficonsole.cpp @@ -31,17 +31,17 @@ static LoggingWithStorage logger("console"); -static char fatalErrorMessage[200]; +//static char fatalErrorMessage[200]; -void fatal3(char *msg, char *file, int line) { - strncpy(fatalErrorMessage, msg, sizeof(fatalErrorMessage) - 1); - fatalErrorMessage[sizeof(fatalErrorMessage) - 1] = 0; // just to be sure -#if EFI_CUSTOM_PANIC_METHOD - chDbgPanic3(fatalErrorMessage, file, line); -#else - chDbgPanic(fatalErrorMessage); -#endif -} +//void fatal3(char *msg, char *file, int line) { +// strncpy(fatalErrorMessage, msg, sizeof(fatalErrorMessage) - 1); +// fatalErrorMessage[sizeof(fatalErrorMessage) - 1] = 0; // just to be sure +//#if EFI_CUSTOM_PANIC_METHOD +// chDbgPanic3(fatalErrorMessage, file, line); +//#else +// chDbgPanic(fatalErrorMessage); +//#endif +//} static void myfatal(void) { chDbgCheck(0, "my fatal"); diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 17f60879a7..eff4e7798f 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -593,7 +593,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->manifold_air_pressure = getMap(); tsOutputChannels->engineLoad = engineLoad; tsOutputChannels->rpmAcceleration = engine->rpmCalculator.getRpmAcceleration(); - tsOutputChannels->currentMapAccelDelta = engine->mapAccelEnrichment.getMapEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap(); + tsOutputChannels->currentEngineLoadAccelDelta = engine->engineLoadAccelEnrichment.getMapEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap(); tsOutputChannels->tpsAccelFuel = engine->engineState.tpsAccelEnrich; tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getDelta(); tsOutputChannels->triggerErrorsCounter = engine->triggerCentral.triggerState.totalTriggerErrorCounter; diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index 45c110a830..9e652601f5 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -76,8 +76,8 @@ floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) { float AccelEnrichmemnt::getMapEnrichment(DECLARE_ENGINE_PARAMETER_F) { float d = getDelta(); - if (d > engineConfiguration->mapAccelEnrichmentThreshold) { - return d * engineConfiguration->mapAccelEnrichmentMultiplier; + if (d > engineConfiguration->engineLoadAccelEnrichmentThreshold) { + return d * engineConfiguration->engineLoadAccelEnrichmentMultiplier; } // if (d < engineConfiguration->deaccelEnrichmentThreshold) { // return d * engineConfiguration->deaccelEnrichmentMultiplier; @@ -117,7 +117,7 @@ AccelEnrichmemnt::AccelEnrichmemnt() { static void accelInfo() { // scheduleMsg(logger, "MAP accel length=%d", mapInstance.cb.getSize()); - scheduleMsg(logger, "MAP accel th=%f/mult=%f", engineConfiguration->mapAccelEnrichmentThreshold, engineConfiguration->mapAccelEnrichmentMultiplier); + scheduleMsg(logger, "MAP accel th=%f/mult=%f", engineConfiguration->engineLoadAccelEnrichmentThreshold, engineConfiguration->engineLoadAccelEnrichmentMultiplier); scheduleMsg(logger, "MAP decel th=%f/mult=%f", engineConfiguration->decelEnleanmentThreshold, engineConfiguration->decelEnleanmentMultiplier); // scheduleMsg(logger, "TPS accel length=%d", tpsInstance.cb.getSize()); @@ -126,13 +126,13 @@ static void accelInfo() { scheduleMsg(logger, "added to wall=%f/sucked=%f", engineConfiguration->addedToWallCoef, engineConfiguration->suckedOffCoef); } -static void setMapAccelThr(float value) { - engineConfiguration->mapAccelEnrichmentThreshold = value; +static void setengineLoadAccelThr(float value) { + engineConfiguration->engineLoadAccelEnrichmentThreshold = value; accelInfo(); } -static void setMapAccelMult(float value) { - engineConfiguration->mapAccelEnrichmentMultiplier = value; +static void setengineLoadAccelMult(float value) { + engineConfiguration->engineLoadAccelEnrichmentMultiplier = value; accelInfo(); } @@ -165,12 +165,12 @@ static void setTpsAccelLen(int len) { accelInfo(); } -static void setMapAccelLen(int len) { +static void setengineLoadAccelLen(int len) { if (len < 1) { scheduleMsg(logger, "Length should be positive"); return; } - engine->mapAccelEnrichment.cb.setSize(len); + engine->engineLoadAccelEnrichment.cb.setSize(len); accelInfo(); } @@ -180,14 +180,14 @@ void initAccelEnrichment(Logging *sharedLogger) { addConsoleActionF("set_tps_accel_threshold", setTpsAccelThr); addConsoleActionF("set_tps_accel_multiplier", setTpsAccelMult); - addConsoleActionI("set_map_accel_len", setMapAccelLen); - addConsoleActionF("set_map_accel_threshold", setMapAccelThr); - addConsoleActionF("set_map_accel_multiplier", setMapAccelMult); + addConsoleActionI("set_map_accel_len", setengineLoadAccelLen); + addConsoleActionF("set_map_accel_threshold", setengineLoadAccelThr); + addConsoleActionF("set_map_accel_multiplier", setengineLoadAccelMult); addConsoleActionF("set_decel_threshold", setDecelThr); addConsoleActionF("set_decel_multiplier", setDecelMult); addConsoleAction("accelinfo", accelInfo); - setMapAccelLen(engineConfiguration->mapAccelLength); + setengineLoadAccelLen(engineConfiguration->engineLoadAccelLength); setTpsAccelLen(engineConfiguration->tpsAccelLength); } #endif /* ! EFI_UNIT_TEST */ diff --git a/firmware/controllers/algo/advance_map.cpp b/firmware/controllers/algo/advance_map.cpp index 0dd58658d2..7f324840c2 100644 --- a/firmware/controllers/algo/advance_map.cpp +++ b/firmware/controllers/algo/advance_map.cpp @@ -147,3 +147,37 @@ float getTopAdvanceForBore(chamber_style_e style, int octane, double compression float result = base + octaneCorrection + compressionCorrection + boreCorrection; return ((int)(result * 10)) / 10.0; } + +float getAdvanceForRpm(int rpm, float advanceMax) { + if (rpm >= 3000) + return advanceMax; + if (rpm < 600) + return 10; + return interpolate(600, 10, 3000, advanceMax, rpm); +} + +#define round10(x) efiRound(x, 0.1) + +float getInitialAdvance(int rpm, float map, float advanceMax) { + float advance = getAdvanceForRpm(rpm, advanceMax); + return round10(advance + 0.3 * (100 - map)); +} + +void buildTimingMap(float advanceMax DECLARE_ENGINE_PARAMETER_S) { + if (engineConfiguration->algorithm != LM_SPEED_DENSITY && + engineConfiguration->algorithm != LM_MAP) { + warning(OBD_PCM_Processor_Fault, "wrong algorithm for MAP-based timing"); + return; + } + /** + * good enough (but do not trust us!) default timing map in case of MAP-based engine load + */ + for (int loadIndex = 0; loadIndex < IGN_LOAD_COUNT; loadIndex++) { + float load = config->ignitionLoadBins[loadIndex]; + for (int rpmIndex = 0;rpmIndexignitionLoadBins[loadIndex]; + config->ignitionTable[loadIndex][rpmIndex] = getInitialAdvance(rpm, load, advanceMax); + } + } +} + diff --git a/firmware/controllers/algo/advance_map.h b/firmware/controllers/algo/advance_map.h index 6efd11b9de..b0d814d7e4 100644 --- a/firmware/controllers/algo/advance_map.h +++ b/firmware/controllers/algo/advance_map.h @@ -14,5 +14,7 @@ angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S); void setDefaultIatTimingCorrection(DECLARE_ENGINE_PARAMETER_F); void prepareTimingMap(DECLARE_ENGINE_PARAMETER_F); float getTopAdvanceForBore(chamber_style_e style, int octane, double compression, double bore); +float getInitialAdvance(int rpm, float map, float advanceMax); +void buildTimingMap(float advanceMax DECLARE_ENGINE_PARAMETER_S); #endif /* ADVANCE_H_ */ diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 4e546cb2b3..caa21053a6 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -205,7 +205,7 @@ public: */ efitick_t stopEngineRequestTimeNt; - AccelEnrichmemnt mapAccelEnrichment; + AccelEnrichmemnt engineLoadAccelEnrichment; AccelEnrichmemnt tpsAccelEnrichment; TriggerCentral triggerCentral; diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index bee1267af5..85507aa8ad 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 rusefi_config.txt Mon Dec 28 17:33:44 EST 2015 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Dec 31 12:46:57 EST 2015 // begin #include "rusefi_types.h" typedef struct { @@ -1410,7 +1410,7 @@ typedef struct { /** * offset 2196 */ - int mapAccelLength; + int engineLoadAccelLength; /** * offset 2200 */ @@ -1422,11 +1422,11 @@ typedef struct { /** * offset 2208 */ - float mapAccelEnrichmentThreshold; + float engineLoadAccelEnrichmentThreshold; /** * offset 2212 */ - float mapAccelEnrichmentMultiplier; + float engineLoadAccelEnrichmentMultiplier; /** * offset 2216 */ @@ -1595,4 +1595,4 @@ typedef struct { } persistent_config_s; // end -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Dec 28 17:33:44 EST 2015 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Dec 31 12:46:57 EST 2015 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index dc6351d666..72fe1b374d 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -715,13 +715,13 @@ #define tpsAccelEnrichmentThreshold_offset 2188 #define tpsAccelEnrichmentMultiplier_offset 2192 #define tpsAccelEnrichmentMultiplier_offset_hex 890 -#define mapAccelLength_offset 2196 -#define mapAccelLength_offset_hex 894 +#define engineLoadAccelLength_offset 2196 +#define engineLoadAccelLength_offset_hex 894 #define decelEnleanmentThreshold_offset 2200 #define decelEnleanmentThreshold_offset_hex 898 #define decelEnleanmentMultiplier_offset 2204 -#define mapAccelEnrichmentThreshold_offset 2208 -#define mapAccelEnrichmentMultiplier_offset 2212 +#define engineLoadAccelEnrichmentThreshold_offset 2208 +#define engineLoadAccelEnrichmentMultiplier_offset 2212 #define fatalErrorPin_offset 2216 #define warninigPin_offset 2220 #define configResetPin_offset 2224 diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index 1275edbaef..3ffaaf446c 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -181,7 +181,7 @@ static ALWAYS_INLINE void handleFuel(bool_t limitedFuel, uint32_t eventIndex, in engine->tpsAccelEnrichment.onEngineCycleTps(PASS_ENGINE_PARAMETER_F); - engine->mapAccelEnrichment.onEngineCycle(PASS_ENGINE_PARAMETER_F); + engine->engineLoadAccelEnrichment.onEngineCycle(PASS_ENGINE_PARAMETER_F); ENGINE(fuelMs) = getFuelMs(rpm PASS_ENGINE_PARAMETER) * engineConfiguration->globalFuelCorrection; for (int i = 0; i < source->size; i++) { diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 9c03e38107..540da9a7e9 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -614,12 +614,12 @@ baro_corr_table_t baroCorrTable; float tpsAccelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3 float tpsAccelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3 - int mapAccelLength;;"len", 1, 0, 1, 200, 3 + int engineLoadAccelLength;;"len", 1, 0, 1, 200, 3 float decelEnleanmentThreshold;;"roc", 1, 0, 0, 200, 3 float decelEnleanmentMultiplier;;"coeff", 1, 0, 0, 200, 3 - float mapAccelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3 - float mapAccelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3 + float engineLoadAccelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3 + float engineLoadAccelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3 brain_pin_e fatalErrorPin; diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 743edecb28..52583e2154 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -47,7 +47,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Dec 28 17:33:44 EST 2015 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Dec 31 12:46:57 EST 2015 pageSize = 16088 page = 1 @@ -512,11 +512,11 @@ page = 1 tpsAccelLength = scalar, S32, 2184, "len", 1, 0, 1, 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, 1, 200, 3 + engineLoadAccelLength = scalar, S32, 2196, "len", 1, 0, 1, 200, 3 decelEnleanmentThreshold = scalar, F32, 2200, "roc", 1, 0, 0, 200, 3 decelEnleanmentMultiplier = scalar, F32, 2204, "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 + engineLoadAccelEnrichmentThreshold = scalar, F32, 2208, "roc", 1, 0, 0, 200, 3 + engineLoadAccelEnrichmentMultiplier = scalar, F32, 2212, "coeff", 1, 0, 0, 200, 3 fatalErrorPin = bits, U32, 2216, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "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", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" warninigPin = bits, U32, 2220, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "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", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" configResetPin = bits, U32, 2224, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "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", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" @@ -696,7 +696,7 @@ fileVersion = { 20151201 } veValue = scalar, F32, 112, "ratio", 1, 0 deltaTps = scalar, F32, 116, "ratio", 1, 0 triggerErrorsCounter = scalar, U32,120, "counter", 1, 0 - currentMapAccelDelta = scalar,F32, 124, "%", 1, 0 + currentEngineLoadAccelDelta = scalar,F32, 124, "%", 1, 0 tpsAccelFuel = scalar, F32, 128, "ms", 1, 0 baroCorrection = scalar, F32, 132, "%", 1, 0 pedalPosition = scalar, F32, 136, "%", 1, 0 @@ -918,7 +918,7 @@ fileVersion = { 20151201 } veValueGauge = veValue, "%", "", 0, 120, 10, 10, 100, 100, 1, 1 deltaTpsGauge = deltaTps, "%", "", 0, 120, 10, 10, 100, 100, 1, 1 ; minDeltaGauge = minDelta, "%", "", 0, 120, 10, 10, 100, 100, 1, 1 - currentMapAccelDeltaGauge = currentMapAccelDelta,"MAP enrich","%", 0, 120, 10, 10, 100, 100, 1, 1 + currentEngineLoadAccelDeltaGauge = currentEngineLoadAccelDelta,"EL enrich","%", 0, 120, 10, 10, 100, 100, 1, 1 tpsAccelFuelGauge = tpsAccelFuel,"TPS enrich", "ms", 0, 120, 10, 10, 100, 100, 1, 1 baroCorrectionGauge = baroCorrection,"BaroCorr", "%", 0, 120, 10, 10, 100, 100, 1, 1 pedalPositionGauge = pedalPosition,"Pedal Position", "%", 0, 120, 10, 10, 100, 100, 1, 1 @@ -997,7 +997,7 @@ fileVersion = { 20151201 } entry = rpmAcceleration, "dRPM", float, "%.3f" entry = massAirFlowValue,"Mass", float, "%.3f" entry = veValue, "ratio", float, "%.3f" - entry = currentMapAccelDelta, "mapAccel",float, "%.3f" + entry = currentEngineLoadAccelDelta, "accel",float, "%.3f" entry = tpsAccelFuel, "tpsAccel", float, "%.3f" entry = baroCorrection "baroCorrection",float,"%.3f" entry = pedalPosition, "pedal", float, "%.3f" @@ -1445,9 +1445,9 @@ fileVersion = { 20151201 } ; Tuning->AccelEnrichment dialog = AccelEnrich, "AccelEnrichment" - field = "MAP accel length", mapAccelLength - field = "MAP Accel threshold", mapAccelEnrichmentThreshold - field = "MAP Accel Mult", mapAccelEnrichmentMultiplier + field = "Engine Load accel length", engineLoadAccelLength + field = "Engine Load Accel threshold", engineLoadAccelEnrichmentThreshold + field = "Engine Accel Mult", engineLoadAccelEnrichmentMultiplier field = "TPS accel length", tpsAccelLength field = "TPS Accel threshold", tpsAccelEnrichmentThreshold field = "TPS Accel Mult", tpsAccelEnrichmentMultiplier diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 8aacf0dbe6..32ed072f36 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 rusefi_config.txt Mon Dec 28 17:33:44 EST 2015 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Dec 31 12:46:57 EST 2015 public class Fields { public static final Field ENGINETYPE = new Field("ENGINETYPE", 0, FieldType.INT); public static final Field UNUSEDOFFSET4 = new Field("UNUSEDOFFSET4", 4, FieldType.INT); @@ -449,11 +449,11 @@ public class Fields { public static final Field TPSACCELLENGTH = new Field("TPSACCELLENGTH", 2184, FieldType.INT); public static final Field TPSACCELENRICHMENTTHRESHOLD = new Field("TPSACCELENRICHMENTTHRESHOLD", 2188, FieldType.FLOAT); public static final Field TPSACCELENRICHMENTMULTIPLIER = new Field("TPSACCELENRICHMENTMULTIPLIER", 2192, FieldType.FLOAT); - public static final Field MAPACCELLENGTH = new Field("MAPACCELLENGTH", 2196, FieldType.INT); + public static final Field ENGINELOADACCELLENGTH = new Field("ENGINELOADACCELLENGTH", 2196, FieldType.INT); public static final Field DECELENLEANMENTTHRESHOLD = new Field("DECELENLEANMENTTHRESHOLD", 2200, FieldType.FLOAT); public static final Field DECELENLEANMENTMULTIPLIER = new Field("DECELENLEANMENTMULTIPLIER", 2204, FieldType.FLOAT); - public static final Field MAPACCELENRICHMENTTHRESHOLD = new Field("MAPACCELENRICHMENTTHRESHOLD", 2208, FieldType.FLOAT); - public static final Field MAPACCELENRICHMENTMULTIPLIER = new Field("MAPACCELENRICHMENTMULTIPLIER", 2212, FieldType.FLOAT); + public static final Field ENGINELOADACCELENRICHMENTTHRESHOLD = new Field("ENGINELOADACCELENRICHMENTTHRESHOLD", 2208, FieldType.FLOAT); + public static final Field ENGINELOADACCELENRICHMENTMULTIPLIER = new Field("ENGINELOADACCELENRICHMENTMULTIPLIER", 2212, FieldType.FLOAT); public static final Field FATALERRORPIN = new Field("FATALERRORPIN", 2216, FieldType.INT, brain_pin_e); public static final Field WARNINIGPIN = new Field("WARNINIGPIN", 2220, FieldType.INT, brain_pin_e); public static final Field CONFIGRESETPIN = new Field("CONFIGRESETPIN", 2224, FieldType.INT, brain_pin_e); diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index afef1a38c9..f14ff8bf61 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -170,10 +170,10 @@ void print(const char *format, ...) { va_end(ap); } -void fatal3(char *msg, char *file, int line) { - printf(msg); - exit(-1); -} +//void fatal3(char *msg, char *file, int line) { +// printf(msg); +// exit(-1); +//} int warning(const char *fmt, ...) { printf(fmt); diff --git a/unit_tests/test_engine_math.cpp b/unit_tests/test_engine_math.cpp index 1f08a66b59..a75f0510f1 100644 --- a/unit_tests/test_engine_math.cpp +++ b/unit_tests/test_engine_math.cpp @@ -55,6 +55,8 @@ void testIgnitionMapGenerator(void) { assertEquals(22.0, getTopAdvanceForBore(CS_SWIRL_TUMBLE, 89, 9, 101.6)); assertEquals(32.2, getTopAdvanceForBore(CS_SWIRL_TUMBLE, 89, 9, 145)); + assertEquals(47.5, getInitialAdvance(2400, 40, 36)); + assertEquals(54.0, getInitialAdvance(4400, 40, 36)); } void testMafLookup(void) {