Move hard and soft cut rev limits from test branch
This commit is contained in:
parent
533bec0f35
commit
bded6c64b8
|
@ -126,10 +126,10 @@ struct config2 {
|
|||
byte triggerMissingTeeth; //The size of the tooth gap (ie number of missing teeth)
|
||||
byte crankRPM; //RPM below which the engine is considered to be cranking
|
||||
byte floodClear; //TPS value that triggers flood clear mode (No fuel whilst cranking)
|
||||
byte unused3;
|
||||
byte unused4;
|
||||
byte unused5;
|
||||
byte unused6;
|
||||
byte SoftRevLim; //Soft rev limit (RPM/100)
|
||||
byte SoftLimRetard; //Amount soft limit retards (degrees)
|
||||
byte SoftLimMax; //Time the soft limit can run
|
||||
byte HardRevLim; //Hard rev limit (RPM/100)
|
||||
byte unused7;
|
||||
byte unused8;
|
||||
byte unused9;
|
||||
|
|
|
@ -262,6 +262,7 @@ void loop()
|
|||
//int ignitionStartAngle = 360 - ignitionAdvance - (configPage2.dwellRun / timePerDegree); // 360 - desired advance angle - number of degrees the dwell will take
|
||||
int injector1StartAngle = 355 - ( fastDivide32(currentStatus.PW, timePerDegree) ); //As above, but using fastDivide function
|
||||
int ignition1StartAngle = 360 - currentStatus.advance - (fastDivide32((configPage2.dwellRun*100), timePerDegree) ); //As above, but using fastDivide function
|
||||
if (currentStatus.RPM > ((int)(configPage2.SoftRevLim * 100)) ) { ignition1StartAngle = ignition1StartAngle + configPage2.SoftLimRetard; } //Softcut RPM limit (If we're above softcut limit, delay timing by configured number of degrees)
|
||||
|
||||
//Finally calculate the time (uS) until we reach the firing angles and set the schedules
|
||||
//We only need to set the shcedule if we're BEFORE the open angle
|
||||
|
@ -275,13 +276,16 @@ void loop()
|
|||
);
|
||||
}
|
||||
//Likewise for the ignition
|
||||
if (ignition1StartAngle > crankAngle)
|
||||
if ( ignition1StartAngle > crankAngle)
|
||||
{
|
||||
setIgnitionSchedule1(beginCoil1Charge,
|
||||
(ignition1StartAngle - crankAngle) * timePerDegree,
|
||||
(configPage2.dwellRun * 100), //Dwell is stored as ms * 10. ie Dwell of 4.3ms would be 43 in configPage2. This number therefore needs to be multiplied by 100 to get dwell in uS
|
||||
endCoil1Charge
|
||||
);
|
||||
if (currentStatus.RPM < ((int)(configPage2.HardRevLim) * 100) ) //Check for hard cut rev limit (If we're above the hardcut limit, we simply don't set a spark schedule)
|
||||
{
|
||||
setIgnitionSchedule1(beginCoil1Charge,
|
||||
(ignition1StartAngle - crankAngle) * timePerDegree,
|
||||
(configPage2.dwellRun * 100), //Dwell is stored as ms * 10. ie Dwell of 4.3ms would be 43 in configPage2. This number therefore needs to be multiplied by 100 to get dwell in uS
|
||||
endCoil1Charge
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -200,6 +200,12 @@
|
|||
crankRPM = scalar, U08, 97, "rpm", 100.0, 0.0, 100, 1000, 0
|
||||
tpsflood = scalar, U08, 98, "raw", 1.0, 0.0, 0.0, 255.0, 0
|
||||
|
||||
;Rev Limits
|
||||
SoftRevLim = scalar, U08, 99, "rpm", 100.0, 0.0, 100, 25500, 0
|
||||
SoftLimRetard = scalar, U08, 100, "deg", 0.352, -28.4, -10, 80, 0
|
||||
SoftLimMax = scalar, U08, 101, "s", 0.1, 0.0, 0.0, 25.5, 1
|
||||
HardRevLim = scalar, U08, 102, "rpm", 100, 0.0, 100, 25500, 0
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
[Menu]
|
||||
|
@ -238,6 +244,7 @@
|
|||
subMenu = accelEnrichments, "&Acceleration Wizard"
|
||||
subMenu = veTableTbl, "&VE Table", 0
|
||||
subMenu = sparkTbl, "&Spark Table", 1
|
||||
subMenu = RevLimiterS, "Rev Limits", 2
|
||||
|
||||
menu = "&Spark"
|
||||
subMenu = sparkSettings, "&Spark Settings"
|
||||
|
@ -373,6 +380,14 @@
|
|||
field = "is applied. At higher voltages the time is reduced"
|
||||
field = "and when low it is increased"
|
||||
|
||||
dialog = RevLimiterS, "Rev Limiter", 4
|
||||
topicHelp = Fhelp7
|
||||
field = "Rev Limiter"
|
||||
field = "Soft rev limit", SoftRevLim
|
||||
field = "Soft limit absolute timing", SoftLimRetard
|
||||
field = "Soft limit max time", SoftLimMax
|
||||
field = "Hard Rev limit", HardRevLim
|
||||
|
||||
; [CurveEditor]
|
||||
|
||||
;time-based accel enrichment
|
||||
|
|
Loading…
Reference in New Issue