Add option to specify min absolute delta values for AE

This commit is contained in:
Josh Stewart 2022-08-30 11:23:25 +10:00
parent aee331af9d
commit 739dc06f24
5 changed files with 29 additions and 36 deletions

View File

@ -306,16 +306,10 @@ page = 1
maeThresh = scalar, U08, 18, "kPa/s", 1.0, 0.0, 0.0, 255, 0 ;MAP threshold for triggering AE
taeThresh = scalar, U08, 19, "%/s", 1.0, 0.0, 0.0, 255, 0 ;TPS threshold for triggering AE
aeTime = scalar, U08, 20, "ms", 10, 0.0, 0.0, 2550, 0
taeMinChange = scalar, U08, 21, "%", 0.5, 0, 0, 5.0, 1
maeMinChange = scalar, U08, 22, "kPa", 1.0, 0, 0, 10.0, 0
; Display (Options for what the display is showing)
display = bits, U08, 21, [0:2], "Unused", "Adafruit 128x32", "Generic 128x32", "Adafruit 128x64", "Generic 128x64", "INVALID", "INVALID", "INVALID"
display1 = bits, U08, 21, [3:5], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT"
display2 = bits, U08, 21, [6:7], "O2", "Voltage", "CPU", "Mem"
display3 = bits, U08, 22, [0:2], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT"
display4 = bits, U08, 22, [3:4], "O2", "Voltage", "CPU", "Mem"
display5 = bits, U08, 22, [5:7], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT"
displayB1 = bits, U08, 23, [0:3], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT"
displayB2 = bits, U08, 23, [4:7], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT"
@ -1566,6 +1560,8 @@ page = 15
defaultValue = bootloaderCaps, 0
defaultValue = aeTaperMin, 1000
defaultValue = aeTaperMax, 5000
defaultValue = taeMinChange, 2
defaultValue = taeMinChange, 2
defaultValue = aeColdPct, 100
defaultValue = aeColdTaperMin, 0
defaultValue = aeColdTaperMax, 60
@ -1994,6 +1990,10 @@ menuDialog = main
aeColdPct = "Acceleration enrichment adjustment for cold engine. Cold adjustment % is tapered between start and end temperatures.\n100% = no adjustment."
aeColdTaperMin = "AE cold adjustment taper start temperature. When coolant is below this value, full cold adjustment is applied."
aeColdTaperMax = "AE cold adjustment taper end temperature. When coolant is above this value, no cold adjustment is applied."
maeThresh = "The minimum speed that MAP must change at to trigger AE. Typical values are 40-100kPa/s"
taeThresh = "The minimum speed that TPS must change at to trigger AE. Typical values are 40-100%/s"
taeMinChange = "The minimum absolute change in TPS in order to engage AE. Typical values are 0-3%"
maeMinChange = "The minimum absolute change in MAP in order to engage AE. Typical values are 0-5%"
dfcoRPM = "The RPM above which DFCO will be active. Typically set a few hundred RPM above maximum idle speed"
dfcoHyster = "Hysteresis for DFCO RPM. 200-300 RPM is typical for this, however a higher value may be needed if the RPM is fluctuating around the cutout speed"
dfcoTPSThresh = "The TPS value below which DFCO will be active. Typical value is 5%-10%, but higher may be needed if TPS signal is noisy"
@ -2495,8 +2495,10 @@ menuDialog = main
dialog = accelEnrichments_aeSettings, ""
field = "Enrichment mode", aeMode
field = "Enrichment method", aeApplyMode
field = "TPSdot Threshold", taeThresh, { aeMode == 0 }
field = "MAPdot Threshold", maeThresh, { aeMode == 1 }
field = "TPSdot Threshold", taeThresh, { aeMode == 0 }
field = "Min. TPS change", taeMinChange, { aeMode == 0 }
field = "MAPdot Threshold", maeThresh, { aeMode == 1 }
field = "Min. MAP change", maeMinChange, { aeMode == 1 }
field = "Accel Time", aeTime
field = "Taper Start RPM", aeTaperMin
field = "Taper End RPM", aeTaperMax
@ -2960,18 +2962,6 @@ menuDialog = main
panel = NitrousStage1, West, { n2o_enable > 0 }
panel = NitrousStage2, East, { n2o_enable > 1 }
dialog = OLED, "OLED Display", 2
field = "Display Type", display
field = "#Note"
field = "ECU must be rebooted after changing above value"
field = "Field 1", display1, { display }
field = "Field 2", display2, { display }
field = "Field 3", display3, { display }
field = "Field 4", display4, { display }
;field = "Bar 1", displayB1, { display }
;field = "Bar 2", displayB2, { display > 2 }
dialog = batCal, "Calibrate voltage reading"
topicHelp = "https://wiki.speeduino.com/en/configuration/Sensor_Calibration"
slider = "Battery Voltage reading offset", batVoltCorrect, horizontal

View File

@ -6,7 +6,6 @@ All functions in the gamma file return
#define CORRECTIONS_H
#define IGN_IDLE_THRESHOLD 200 //RPM threshold (below CL idle target) for when ign based idle control will engage
#define TPSAE_ABSOLUTE_THRESHOLD 4 //TPS absolute threshold for when AE based idle control will engage, This equates to 2% throttle movement once the 0.5% resolution is applied
void initialiseCorrections();

View File

@ -343,7 +343,7 @@ uint16_t correctionAccel()
{
if(configPage2.aeMode == AE_MODE_MAP)
{
if (MAP_change <= 2)
if (MAP_change <= configPage2.maeMinChange)
{
accelValue = 100;
currentStatus.mapDOT = 0;
@ -401,8 +401,8 @@ uint16_t correctionAccel()
{
//Check for deceleration (Deceleration adjustment not yet supported)
//Also check for only very small movement (Movement less than or equal to 2% is ignored). This not only means we can skip the lookup, but helps reduce false triggering around 0-2% throttle openings
if (TPS_change <= TPSAE_ABSOLUTE_THRESHOLD)
//Also check for only very small movement. This not only means we can skip the lookup, but helps reduce false triggering around 0-2% throttle openings
if (TPS_change <= configPage2.taeMinChange)
{
accelValue = 100;
currentStatus.tpsDOT = 0;

View File

@ -777,16 +777,10 @@ struct config2 {
byte maeThresh; /**< The MAPdot threshold that must be exceeded before AE is engaged */
byte taeThresh; /**< The TPSdot threshold that must be exceeded before AE is engaged */
byte aeTime;
byte taeMinChange; /**< The minimum change in TPS that must be made before AE is engaged */
byte maeMinChange; /**< The minimum change in MAP that must be made before AE is engaged */
//Display config bits
byte displayType : 3; //21
byte display1 : 3;
byte display2 : 2;
byte display3 : 3; //22
byte display4 : 2;
byte display5 : 3;
byte displayB1 : 4; //23
byte displayB2 : 4;

View File

@ -16,7 +16,7 @@
void doUpdates()
{
#define CURRENT_DATA_VERSION 20
#define CURRENT_DATA_VERSION 21
//Only the latest update for small flash devices must be retained
#ifndef SMALL_FLASH_MODE
@ -608,7 +608,7 @@ void doUpdates()
if(readEEPROMVersion() == 19)
{
//202204
//202207
//Option added to select injector pairing on 4 cylinder engines
if( configPage4.inj4cylPairing > INJ_PAIR_14_23 ) { configPage4.inj4cylPairing = 0; } //Check valid value
@ -673,6 +673,16 @@ void doUpdates()
writeAllConfig();
storeEEPROMVersion(20);
}
if(readEEPROMVersion() == 20)
{
//202210
configPage2.taeMinChange = 4; //Default is 2% minimum change to match prior behaviour. (4 = 2% account for 0.5 resolution)
configPage2.maeMinChange = 2; //Default is 2% minimum change to match prior behaviour.
writeAllConfig();
storeEEPROMVersion(21);
}
//Final check is always for 255 and 0 (Brand new arduino)
if( (readEEPROMVersion() == 0) || (readEEPROMVersion() == 255) )