Added option for soft limit to also be able to retard by x-amount of degrees (#368)

* Changed the soft limit from absolute value to retard by

* Added selection for fixed and relative retard

Co-authored-by: Pasi Kemppainen <pazi88@users.noreply.github.com>
This commit is contained in:
Pasi Kemppainen 2020-05-09 01:39:13 +03:00 committed by GitHub
parent 1530bb892e
commit b7e91b58df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 4 deletions

View File

@ -227,7 +227,8 @@ page = 1
aeMode = bits, U08, 3, [0:1], "TPS", "MAP", "INVALID", "INVALID" aeMode = bits, U08, 3, [0:1], "TPS", "MAP", "INVALID", "INVALID"
battVCorMode = bits, U08, 3, [2:2], "Whole PW", "Open Time only" 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 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 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" 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" 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" 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" 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" 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" 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" topicHelp = "https://wiki.speeduino.com/en/configuration/Rev_Limits"
field = "Rev Limiter" field = "Rev Limiter"
field = "Soft rev limit", SoftRevLim 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 = "Soft limit max time", SoftLimMax
field = "Hard Rev limit", HardRevLim field = "Hard Rev limit", HardRevLim
field = "Hard limiter method", hardCutType field = "Hard limiter method", hardCutType

View File

@ -690,7 +690,13 @@ int8_t correctionSoftRevLimit(int8_t advance)
{ {
byte ignSoftRevValue = advance; byte ignSoftRevValue = advance;
BIT_CLEAR(currentStatus.spark, BIT_SPARK_SFTLIM); 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; return ignSoftRevValue;
} }

View File

@ -238,6 +238,8 @@
#define OPEN_LOOP_BOOST 0 #define OPEN_LOOP_BOOST 0
#define CLOSED_LOOP_BOOST 1 #define CLOSED_LOOP_BOOST 1
#define SOFT_LIMIT_FIXED 0
#define SOFT_LIMIT_RELATIVE 1
#define VVT_MODE_ONOFF 0 #define VVT_MODE_ONOFF 0
#define VVT_MODE_OPEN_LOOP 1 #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 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 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 battVCorMode : 1;
byte unused1_3c : 5; byte SoftLimitMode : 1;
byte unused1_3c : 4;
byte wueValues[10]; //Warm up enrichment array (10 bytes) byte wueValues[10]; //Warm up enrichment array (10 bytes)
byte crankingPct; //Cranking enrichment byte crankingPct; //Cranking enrichment
byte pinMapping; // The board / ping mapping to be used byte pinMapping; // The board / ping mapping to be used

View File

@ -337,6 +337,9 @@ void doUpdates()
writeAllConfig(); writeAllConfig();
EEPROM.write(EEPROM_DATA_VERSION, 14); 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) //Final check is always for 255 and 0 (Brand new arduino)