diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 2126e5bf..2dd2cf80 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -227,7 +227,8 @@ page = 1 aeMode = bits, U08, 3, [0:1], "TPS", "MAP", "INVALID", "INVALID" battVCorMode = bits, U08, 3, [2:2], "Whole PW", "Open Time only" - unused1-3c = bits, U08, 3, [3:7], "MAP", "TPS", "INVALID", "INVALID" + SoftLimitMode = bits, U08, 3, [3:3], "Fixed", "Relative " + unused1-3c = bits, U08, 3, [4:7], "MAP", "TPS", "INVALID", "INVALID" wueRates = array, U08, 4, [10], "%", 1.0, 0.0, 0.0, 255, 0 crankingPct = scalar, U08, 14, "%", 1.0, 0.0, 0.0, 255, 0 pinLayout = bits, U08, 15, [0:7], "Speeduino v0.1", "Speeduino v0.2", "Speeduino v0.3", "Speeduino v0.4", "INVALID", "INVALID", "01-05 MX5 PNP", "INVALID", "96-97 MX5 PNP", "NA6 MX5 PNP", "Turtana PCB", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "Plazomat I/O 0.1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "Daz V6 Shield 0.1", "BMW PnP", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "NO2C", "UA4C", "INVALID", "INVALID", "INVALID", "DIY-EFI CORE4 v1.0", "INVALID", "INVALID", "INVALID", "INVALID", "dvjcodec Teensy RevA", "dvjcodec Teensy RevB", "INVALID", "INVALID", "INVALID", "Drop Bear", "INVALID", "INVALID", "INVALID", "INVALID", "Black STM32F407VET6 V0.1", "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", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" @@ -1528,6 +1529,8 @@ menuDialog = main flatSSoftWin= "The number of RPM below the flat shift point where the softlimit will be applied (aka Soft limit window). Recommended values are 200-1000" flatSRetard = "The absolute timing (BTDC) that will be used when within the soft limit window" hardCutType = "How hard cuts should be performed for rev/launch limits. Full cut will stop all ignition events, Rolling cut will step through all ignition outputs, only cutting 1 per revolution" + SoftLimitMode = "Fixed: the soft limiter will retard the ignition advance to the specified value.\nRelative: current timing advance will be retarted by the specified amount" + fuel2InputPin = "The Arduino pin that is being used to trigger the second fuel table to be active" fuel2InputPolarity = "Whether the 2nd fuel table should be active when input is high or low. This should be LOW for a typical ground switching input" @@ -2128,7 +2131,8 @@ menuDialog = main topicHelp = "https://wiki.speeduino.com/en/configuration/Rev_Limits" field = "Rev Limiter" field = "Soft rev limit", SoftRevLim - field = "Soft limit absolute timing", SoftLimRetard + field = "Soft limiter mode", SoftLimitMode + field = "Soft limit timing", SoftLimRetard field = "Soft limit max time", SoftLimMax field = "Hard Rev limit", HardRevLim field = "Hard limiter method", hardCutType diff --git a/speeduino/corrections.ino b/speeduino/corrections.ino index f855c263..51c04779 100644 --- a/speeduino/corrections.ino +++ b/speeduino/corrections.ino @@ -690,7 +690,13 @@ int8_t correctionSoftRevLimit(int8_t advance) { byte ignSoftRevValue = advance; BIT_CLEAR(currentStatus.spark, BIT_SPARK_SFTLIM); - if (currentStatus.RPM > ((unsigned int)(configPage4.SoftRevLim) * 100) ) { BIT_SET(currentStatus.spark, BIT_SPARK_SFTLIM); ignSoftRevValue = configPage4.SoftLimRetard; } //Softcut RPM limit (If we're above softcut limit, delay timing by configured number of degrees) + if (currentStatus.RPM > ((unsigned int)(configPage4.SoftRevLim) * 100) ) //Softcut RPM limit + { + BIT_SET(currentStatus.spark, BIT_SPARK_SFTLIM); + if (configPage2.SoftLimitMode == SOFT_LIMIT_RELATIVE) { ignSoftRevValue = ignSoftRevValue - configPage4.SoftLimRetard; } //delay timing by configured number of degrees in relative mode + else if (configPage2.SoftLimitMode == SOFT_LIMIT_FIXED) { ignSoftRevValue = configPage4.SoftLimRetard; } //delay timing to configured number of degrees in fixed mode + + } return ignSoftRevValue; } diff --git a/speeduino/globals.h b/speeduino/globals.h index 674d5e54..dcb59950 100644 --- a/speeduino/globals.h +++ b/speeduino/globals.h @@ -238,6 +238,8 @@ #define OPEN_LOOP_BOOST 0 #define CLOSED_LOOP_BOOST 1 +#define SOFT_LIMIT_FIXED 0 +#define SOFT_LIMIT_RELATIVE 1 #define VVT_MODE_ONOFF 0 #define VVT_MODE_OPEN_LOOP 1 @@ -536,7 +538,8 @@ struct config2 { byte aeColdTaperMin; //AE cold modifier, taper start temp (full modifier), was ASE in early versions byte aeMode : 2; /**< Acceleration Enrichment mode. 0 = TPS, 1 = MAP. Values 2 and 3 reserved for potential future use (ie blended TPS / MAP) */ byte battVCorMode : 1; - byte unused1_3c : 5; + byte SoftLimitMode : 1; + byte unused1_3c : 4; byte wueValues[10]; //Warm up enrichment array (10 bytes) byte crankingPct; //Cranking enrichment byte pinMapping; // The board / ping mapping to be used diff --git a/speeduino/updates.ino b/speeduino/updates.ino index 4699203f..13756e0c 100644 --- a/speeduino/updates.ino +++ b/speeduino/updates.ino @@ -337,6 +337,9 @@ void doUpdates() writeAllConfig(); EEPROM.write(EEPROM_DATA_VERSION, 14); + + // there is now optioon for fixed and relative timing retard for soft limit. This sets the soft limiter to the old fixed timing mode. + configPage2.SoftLimitMode = SOFT_LIMIT_FIXED; } //Final check is always for 255 and 0 (Brand new arduino)