Initial work on boost cutout

This commit is contained in:
Josh Stewart 2016-04-12 23:22:14 +10:00
parent d10608e493
commit 1fe8f115f8
3 changed files with 46 additions and 16 deletions

View File

@ -28,8 +28,8 @@ const int map_page_size = 288;
#define BIT_SQUIRT_INJ2 1 //inj2 Squirt
#define BIT_SQUIRT_INJ3 2 //inj3 Squirt
#define BIT_SQUIRT_INJ4 3 //inj4 Squirt
#define BIT_SQUIRT_DFCO 4
#define BIT_SQUIRT_INJ2SQRT 5 //Injector2 (Schedule2)
#define BIT_SQUIRT_DFCO 4 //Decelleration fuel cutoff
#define BIT_SQUIRT_BOOSTCUT 5 //Fuel component of MAP based boost cut out
#define BIT_SQUIRT_TOOTHLOG1READY 6 //Used to flag if tooth log 1 is ready
#define BIT_SQUIRT_TOOTHLOG2READY 7 //Used to flag if tooth log 2 is ready (Log is not currently used)
@ -38,7 +38,7 @@ const int map_page_size = 288;
#define BIT_SPARK_SLAUNCH 1 //Soft Launch indicator
#define BIT_SPARK_HRDLIM 2 //Hard limiter indicator
#define BIT_SPARK_SFTLIM 3 //Soft limiter indicator
#define BIT_SPARK_UNUSED2 4 //
#define BIT_SPARK_BOOSTCUT 4 //Spark component of MAP based boost cut out
#define BIT_SPARK_UNUSED3 5 //
#define BIT_SPARK_UNUSED4 6 //
#define BIT_SPARK_UNUSED5 7 //
@ -285,7 +285,7 @@ struct config3 {
byte egoType : 2;
byte boostEnabled : 1;
byte vvtEnabled : 1;
byte unused : 2;
byte boostCutType : 2;
byte egoKP;
byte egoKI;
@ -322,7 +322,8 @@ struct config3 {
byte idleKP;
byte idleKI;
byte idleKD;
byte unused56;
byte boostLimit; //Is divided by 2, allowing kPa values up to 511
byte unused57;
byte unused58;
byte unused59;

View File

@ -288,7 +288,7 @@ page = 6
egoType = bits , U08, 0, [2:3], "Disabled", "Narrow Band", "Wide Band", "INVALID" ; egoOption
boostEnabled= bits, U08, 0, [4:4], "Off", "On"
vvtEnabled = bits, U08, 0, [5:5], "Off", "On"
unused = bits, U08, 0, [6:7], "Off", "On/Off", "PWM","Centred PID"
boostCutType= bits, U08, 0, [6:7], "Off", "Spark Only", "Fuel Only","Both"
egoKP = scalar, U08, 1, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
egoKI = scalar, U08, 2, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
@ -332,10 +332,10 @@ page = 6
lnchHardLim = scalar, U08, 51, "rpm", 100, 0.0, 100, 25500, 0
lnchFuelAdd = scalar, U08, 52, "%", 1.0, 0.0, 0.0, 80, 0
idleKP = scalar, U08, 53, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
idleKI = scalar, U08, 54, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
idleKD = scalar, U08, 55, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
unused6-56 = scalar, U08, 56, "RPM", 100.0, 0.0, 100, 25500, 0
idleKP = scalar, U08, 53, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
idleKI = scalar, U08, 54, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
idleKD = scalar, U08, 55, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
boostLimit = scalar, U08, 56, "kPa", 2.0, 0.0, 0, 511, 0
unused6-57 = scalar, U08, 57, "RPM", 100.0, 0.0, 100, 25500, 0
unused6-58 = scalar, U08, 58, "RPM", 100.0, 0.0, 100, 25500, 0
unused6-59 = scalar, U08, 59, "RPM", 100.0, 0.0, 100, 25500, 0
@ -348,7 +348,7 @@ page = 6
;Start idle and fan controls (Page 7)
;--------------------------------------------------
page = 7
iacCLValues = array, U08, 0, [10], "RPM", 10.0, 0.0, 100.0, 2550, 0
iacCLValues = array, U08, 0, [10], "RPM", 10.0, 0.0, 0, 2550, 0
iacOLStepVal = array, U08, 10, [10], "Steps", 3, 0, 0, 765, 0
iacOLPWMVal = array, U08, 20, [10], "Duty %", 1.0, 0, 0, 100, 0
#if CELSIUS
@ -794,6 +794,8 @@ page = 8
dialog = boostSettings, "Boost Control"
field = "Boost Control Enabled", boostEnabled
field = "Boost solenoid freq.", boostFreq
field = "Boost Cut", boostCutType
field = "Boost Limit", boostLimit, { boostCutType }
dialog = vvtSettings, "VVT Control"
field = "VVT Control Enabled", vvtEnabled
@ -1086,6 +1088,7 @@ page = 8
indicator = { launchSoft }, "Launch Soft", "Launch Soft", white, black, green, black
indicator = { softlimitOn }, "Soft Limiter OFF", "Soft Limiter",white, black, red, black
indicator = { hardlimitOn }, "Hard Limiter OFF", "Hard Limiter",white, black, red, black
indicator = { boostCutOut }, "Boost Cut OFF", "Boost Cut",white, black, red, black
;-------------------------------------------------------------------------------
@ -1173,7 +1176,7 @@ page = 8
inj3Status = bits, U08, 1, [2:2]
inj4Status = bits, U08, 1, [3:3]
DFCOOn = bits, U08, 1, [4:4]
unusedSquirt1 = bits, U08, 1, [5:5]
boostCutFuel = bits, U08, 1, [5:5]
toothLog1Ready = bits, U08, 1, [6:6]
toothLog2Ready = bits, U08, 1, [7:7]
engine = scalar, U08, 2, "bits", 1.000, 0.000
@ -1213,7 +1216,7 @@ page = 8
launchSoft = bits, U08, 29, [1:1]
hardLimitOn = bits, U08, 29, [2:2]
softlimitOn = bits, U08, 29, [3:3]
sparkUnusede = bits, U08, 29, [4:4]
boostCutSpark = bits, U08, 29, [4:4]
sparkUnusedf = bits, U08, 29, [5:5]
sparkUnusedg = bits, U08, 29, [6:6]
sparkUnusedh = bits, U08, 29, [7:7]
@ -1235,7 +1238,6 @@ page = 8
seconds = { secl };
afrtarget = { 0 }
throttle = { tps }, "%"
;cycleTime = { 60000.0 / rpm * (2.0-twoStroke) }
@ -1243,6 +1245,8 @@ page = 8
nSquirts = { nCylinders/divider }
dutyCycle = { 100.0*pulseWidth/cycleTime }
boostCutOut = { boostCutFuel || boostCutSpark }
#if EXPANDED_CLT_TEMP
clt_exp = { 1 }
#else

View File

@ -681,6 +681,31 @@ void loop()
else { currentStatus.launchingSoft = false; BIT_CLEAR(currentStatus.spark, BIT_SPARK_SLAUNCH); }
if (configPage3.launchEnabled && launchTrigger && (currentStatus.RPM > ((unsigned int)(configPage3.lnchHardLim) * 100)) ) { currentStatus.launchingHard = true; BIT_SET(currentStatus.spark, BIT_SPARK_HLAUNCH); } //HardCut rev limit for 2-step launch control.
else { currentStatus.launchingHard = false; BIT_CLEAR(currentStatus.spark, BIT_SPARK_HLAUNCH); }
//Boost cutoff is very similar to launchControl, but with a check against MAP rather than a switch
if(configPage3.boostCutType && currentStatus.MAP > (configPage3.boostLimit * 2) ) //The boost limit is divided by 2 to allow a limit up to 511kPa
{
switch(configPage3.boostCutType)
{
case 1:
BIT_SET(currentStatus.spark, BIT_SPARK_BOOSTCUT);
BIT_CLEAR(currentStatus.squirt, BIT_SQUIRT_BOOSTCUT);
break;
case 2:
BIT_SET(currentStatus.squirt, BIT_SQUIRT_BOOSTCUT);
BIT_CLEAR(currentStatus.spark, BIT_SPARK_BOOSTCUT);
break;
case 3:
BIT_SET(currentStatus.spark, BIT_SPARK_BOOSTCUT);
BIT_SET(currentStatus.squirt, BIT_SQUIRT_BOOSTCUT);
break;
}
}
else
{
BIT_CLEAR(currentStatus.spark, BIT_SPARK_BOOSTCUT);
BIT_CLEAR(currentStatus.squirt, BIT_SQUIRT_BOOSTCUT);
}
//And check whether the tooth log buffer is ready
if(toothHistoryIndex > TOOTH_LOG_SIZE) { BIT_SET(currentStatus.squirt, BIT_SQUIRT_TOOTHLOG1READY); }
@ -697,9 +722,9 @@ void loop()
vvtControl();
boostControl(); //Most boost tends to run at about 30Hz, so placing it here ensures a new target time is fetched frequently enough
idleControl(); //Perform any idle related actions. Even at higher frequencies, running 4x per second is sufficient.
}
idleControl(); //Perform any idle related actions. Even at higher frequencies, running 4x per second is sufficient.
//Always check for sync
//Main loop runs within this clause
if (currentStatus.hasSync && (currentStatus.RPM > 0))