From bd6fb72ae2d38dd313bd31255ff0d349ffdc19ca Mon Sep 17 00:00:00 2001 From: ConnerMcLaughlin Date: Tue, 27 Dec 2016 13:33:27 -0600 Subject: [PATCH 1/3] Global injector closing angle When user disables individual injector close angle the injectors just go off one setting. --- speeduino.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/speeduino.ino b/speeduino.ino index 3a5534ce..5ddc6d00 100644 --- a/speeduino.ino +++ b/speeduino.ino @@ -1046,6 +1046,7 @@ void loop() //BEGIN INJECTION TIMING //Determine next firing angles currentStatus.PW2 = currentStatus.PW3 = currentStatus.PW4 = currentStatus.PW1; // Initial state is for all pulsewidths to be the same (This gets changed below) + if(!configPage1.indInjAng) {configPage1.inj4Ang = configPage1.inj3Ang = configPage1.inj2Ang = configPage1.inj1Ang;} //Forcing all injector close angles to be the same. int PWdivTimerPerDegree = div(currentStatus.PW1, timePerDegree).quot; //How many crank degrees the calculated PW will take at the current speed injector1StartAngle = configPage1.inj1Ang - ( PWdivTimerPerDegree ); //This is a little primitive, but is based on the idea that all fuel needs to be delivered before the inlet valve opens. See http://www.extraefi.co.uk/sequential_fuel.html for more detail if(injector1StartAngle < 0) {injector1StartAngle += CRANK_ANGLE_MAX_INJ;} @@ -1506,4 +1507,4 @@ void endCoil2and4Charge() { digitalWrite(pinCoil2, coilLOW); digitalWrite(pinCoi void nullCallback() { return; } - + From 6ac880739960e5cfd137ddc77b7667e38c74ed4d Mon Sep 17 00:00:00 2001 From: ConnerMcLaughlin Date: Tue, 27 Dec 2016 13:35:46 -0600 Subject: [PATCH 2/3] Global injector closing angle TS setting Adding TS setting in "Injector Characteristics" --- reference/speeduino.ini | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/reference/speeduino.ini b/reference/speeduino.ini index c1a0e6b7..358cf3de 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -1,4 +1,4 @@ -;------------------------------------------------------------------------------- +;------------------------------------------------------------------------------- #unset CAN_COMMANDS [MegaTune] @@ -167,7 +167,7 @@ page = 2 unused2-26e= bits, U08, 26, [4:4], "No", "Yes" unused2-26f= bits, U08, 26, [5:5], "No", "Yes" unused2-26g= bits, U08, 26, [6:6], "No", "Yes" - unused2-26h= bits, U08, 26, [7:7], "No", "Yes" + indInjAng = bits, U08, 26, [7:7], "Disabled", "Enabled" injOpen = scalar, U08, 27, "ms", 0.1, 0.0, 0.1, 25.5, 1 inj1Ang = scalar, U16, 28, "deg", 1.0, 0.0, 0.0, 360, 0 inj2Ang = scalar, U16, 30, "deg", 1.0, 0.0, 0.0, 360, 0 @@ -537,6 +537,7 @@ page = 9 defaultValue = pinLayout, 1 defaultValue = TrigPattern, 0 defaultValue = sparkMode, 0 + defaultValue = indInjAng, 0 defaultValue = inj1Ang, 355 defaultValue = inj2Ang, 355 defaultValue = inj3Ang, 355 @@ -880,10 +881,12 @@ menuDialog = main dialog = injChars, "Injector Characteristics" field = "Injector Open Time", injOpen field = "Injector close angle" - field = "Channel 1", inj1Ang - field = "Channel 2", inj2Ang, { nCylinders > 1 } - field = "Channel 3", inj3Ang, { nCylinders > 4 || nCylinders == 3 || ((nCylinders == 4) && (injLayout == 3)) } - field = "Channel 4", inj4Ang, { nCylinders > 6 || ((nCylinders == 4) && (injLayout == 3)) } + field = "", inj1Ang, { indInjAng == 0 } + field = "Individual channel setting", indInjAng + field = "Channel 1", inj1Ang, { indInjAng } + field = "Channel 2", inj2Ang, { nCylinders > 1 && indInjAng } + field = "Channel 3", inj3Ang, { indInjAng && (nCylinders > 4 || nCylinders == 3 || ((nCylinders == 4) && (injLayout == 3))) } + field = "Channel 4", inj4Ang, { indInjAng && (nCylinders > 6 || ((nCylinders == 4) && (injLayout == 3))) } field = "Injector Duty Limit", dutyLim panel = injector_voltage_curve From f181bce3af3c18af03435c31dfc704159185f05a Mon Sep 17 00:00:00 2001 From: ConnerMcLaughlin Date: Tue, 27 Dec 2016 13:41:18 -0600 Subject: [PATCH 3/3] Global injector closing angle global var Adding the indInjAng variable which determines whether all close angles will just use inj1Ang --- globals.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/globals.h b/globals.h index 32a40875..5b329555 100644 --- a/globals.h +++ b/globals.h @@ -206,7 +206,8 @@ struct config1 { byte injTiming : 1; byte multiplyMAP : 1; byte includeAFR : 1; - byte unused26 : 5; + byte unused26 : 4; + byte indInjAng : 1; byte injOpen; //Injector opening time (ms * 10) unsigned int inj1Ang; unsigned int inj2Ang;