Merge pull request #63 from ConnerMcLaughlin/master
Global injector close angle
This commit is contained in:
commit
3e24f60a95
|
@ -243,7 +243,8 @@ struct config1 {
|
||||||
byte injTiming : 1;
|
byte injTiming : 1;
|
||||||
byte multiplyMAP : 1;
|
byte multiplyMAP : 1;
|
||||||
byte includeAFR : 1;
|
byte includeAFR : 1;
|
||||||
byte unused26 : 5;
|
byte unused26 : 4;
|
||||||
|
byte indInjAng : 1;
|
||||||
byte injOpen; //Injector opening time (ms * 10)
|
byte injOpen; //Injector opening time (ms * 10)
|
||||||
unsigned int inj1Ang;
|
unsigned int inj1Ang;
|
||||||
unsigned int inj2Ang;
|
unsigned int inj2Ang;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
#unset CAN_COMMANDS
|
#unset CAN_COMMANDS
|
||||||
|
|
||||||
[MegaTune]
|
[MegaTune]
|
||||||
|
@ -168,7 +168,7 @@ page = 2
|
||||||
unused2-26e= bits, U08, 26, [4:4], "No", "Yes"
|
unused2-26e= bits, U08, 26, [4:4], "No", "Yes"
|
||||||
unused2-26f= bits, U08, 26, [5:5], "No", "Yes"
|
unused2-26f= bits, U08, 26, [5:5], "No", "Yes"
|
||||||
unused2-26g= bits, U08, 26, [6:6], "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
|
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
|
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
|
inj2Ang = scalar, U16, 30, "deg", 1.0, 0.0, 0.0, 360, 0
|
||||||
|
@ -544,6 +544,7 @@ page = 9
|
||||||
defaultValue = pinLayout, 1
|
defaultValue = pinLayout, 1
|
||||||
defaultValue = TrigPattern, 0
|
defaultValue = TrigPattern, 0
|
||||||
defaultValue = sparkMode, 0
|
defaultValue = sparkMode, 0
|
||||||
|
defaultValue = indInjAng, 0
|
||||||
defaultValue = inj1Ang, 355
|
defaultValue = inj1Ang, 355
|
||||||
defaultValue = inj2Ang, 355
|
defaultValue = inj2Ang, 355
|
||||||
defaultValue = inj3Ang, 355
|
defaultValue = inj3Ang, 355
|
||||||
|
@ -892,10 +893,12 @@ menuDialog = main
|
||||||
dialog = injChars, "Injector Characteristics"
|
dialog = injChars, "Injector Characteristics"
|
||||||
field = "Injector Open Time", injOpen
|
field = "Injector Open Time", injOpen
|
||||||
field = "Injector close angle"
|
field = "Injector close angle"
|
||||||
field = "Channel 1", inj1Ang
|
field = "", inj1Ang, { indInjAng == 0 }
|
||||||
field = "Channel 2", inj2Ang, { nCylinders > 1 }
|
field = "Individual channel setting", indInjAng
|
||||||
field = "Channel 3", inj3Ang, { nCylinders > 4 || nCylinders == 3 || ((nCylinders == 4) && (injLayout == 3)) }
|
field = "Channel 1", inj1Ang, { indInjAng }
|
||||||
field = "Channel 4", inj4Ang, { nCylinders > 6 || ((nCylinders == 4) && (injLayout == 3)) }
|
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
|
field = "Injector Duty Limit", dutyLim
|
||||||
panel = injector_voltage_curve
|
panel = injector_voltage_curve
|
||||||
|
|
||||||
|
|
|
@ -1033,6 +1033,7 @@ void loop()
|
||||||
//BEGIN INJECTION TIMING
|
//BEGIN INJECTION TIMING
|
||||||
//Determine next firing angles
|
//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)
|
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
|
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
|
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;}
|
if(injector1StartAngle < 0) {injector1StartAngle += CRANK_ANGLE_MAX_INJ;}
|
||||||
|
@ -1438,8 +1439,6 @@ void loop()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue