TPS based accel UI and basic variables

This commit is contained in:
Josh Stewart 2014-02-17 21:54:28 +11:00
parent d718eb4931
commit f8fe318d43
4 changed files with 53 additions and 59 deletions

View File

@ -27,7 +27,13 @@ byte correctionASE()
}
/*
TPS based acceleration enrichment
Calculates the % change of the throttle over time (%/second) and performs a lookup based on this
*/
byte correctionAccel()
{
int rateOfChange = (1000000 / (currentLoopTime - previousLoopTime)) * (currentStatus.TPS - currentStatus.TPSlast); //This is the % per second that the TPS has moved
}

View File

@ -153,28 +153,21 @@ struct config2 {
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;
byte unused10;
byte unused11;
byte unused12;
byte unused13;
byte unused14;
byte unused15;
byte unused16;
byte unused17;
byte unused18;
byte unused19;
byte unused20;
byte unused21;
byte unused22;
byte unused23;
byte unused24;
byte unused25;
byte unused26;
byte unused27;
byte unused28;
byte unused29; //128
byte taeBins[4]; //TPS based acceleration enrichment bins (%/s)
int taeRates[4]; //TPS based acceleration enrichment rates (% to add)
byte unused115;
byte unused116;
byte unused117;
byte unused118;
byte unused119;
byte unused120;
byte unused121;
byte unused122;
byte unused123;
byte unused124;
byte unused125;
byte unused126;
byte unused127;
};

View File

@ -199,6 +199,23 @@
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
;TPS based acceleration enrichment
taeBins = array, U08, 103, [ 4], "%", 1, 0.00000, 0.00, 255, 0
taeRates = array, S16, 107, [ 4], "%/s", 0.10000, 0.00000, 0.00, 5000.00, 1 ; 8 bytes
unused115 = scalar, U08, 115, "none", 0, 0, 0, 0, 0
unused116 = scalar, U08, 116, "none", 0, 0, 0, 0, 0
unused117 = scalar, U08, 117, "none", 0, 0, 0, 0, 0
unused118 = scalar, U08, 118, "none", 0, 0, 0, 0, 0
unused119 = scalar, U08, 119, "none", 0, 0, 0, 0, 0
unused120 = scalar, U08, 120, "none", 0, 0, 0, 0, 0
unused121 = scalar, U08, 121, "none", 0, 0, 0, 0, 0
unused122 = scalar, U08, 122, "none", 0, 0, 0, 0, 0
unused123 = scalar, U08, 123, "none", 0, 0, 0, 0, 0
unused124 = scalar, U08, 124, "none", 0, 0, 0, 0, 0
unused125 = scalar, U08, 125, "none", 0, 0, 0, 0, 0
unused126 = scalar, U08, 126, "none", 0, 0, 0, 0, 0
unused127 = scalar, U08, 127, "none", 0, 0, 0, 0, 0
;-------------------------------------------------------------------------------
@ -276,35 +293,23 @@
; The field name can be either a constant reference, or a reference to another
; dialog which will be added.
; dialogs can be nested and can be mixed with fields
dialog = accelEnrichments, "Acceleration Enrichment"
dialog = accelEnrichments_south, ""
field = "TPSdot Threshold", tpsThresh
field = "Accel Time", taeTime
field = "Cold Accel Enrichment", taeColdA
field = "Cold Accel Mult", taeColdM
field = "Decel Fuel Amount", tdePct
field = "Acceleration Enrichment Bins (ms)"
field = "2 v/s", taeBins1
field = "4 v/s", taeBins2
field = "8 v/s", taeBins3
field = "15 v/s", taeBins4
;time based AE
dialog = time_ae_south, ""
field = "Accel TPSdot threshold", tpsThresh
field = "Decel Fuel Amount", tdePct
field = "Cold Accel Adder", taeColdA
field = "Cold Accel Multiplier", taeColdM
field = "Accel Enrich Down-scaling With RPM"
;field = "Full Accel Below:", ae_lorpm, { !feature7_aeevents }
;field = "Zero Accel Above:", ae_hirpm, { !feature7_aeevents }
dialog = time_ae_north, "", xAxis
panel = time_accel_tpsdot_curve, East, {tpsProportion > 0}
dialog = AEtime_settings, "Time-based Accel Enrichment", yAxis
panel = time_ae_north
panel = time_ae_south
dialog = accelEnrichments_north, "", xAxis
panel = time_accel_tpsdot_curve
;panel = time_accel_tpsdot_tbl
dialog = accelEnrichments, "Acceleration Enrichment"
panel = accelEnrichments_north, North
panel = accelEnrichments_south, South
dialog = crankPW, "Cranking Pulsewidths (ms)"
#if CELSIUS
@ -321,8 +326,6 @@
field = "Enrichment %", asePct
field = "Number of Ignition Cycles", aseCount
dialog = nestedwarmup_curve, "Warmup Enrichment percent multiplier"
panel = warmup_curve
dialog = egoSettings, "Exhaust Gas Oxygen"
field = "EGO Sensor Type", egoType
@ -332,16 +335,6 @@
field = "EGO Step", egoDelta
field = "EGO ± Limit", egoLimit
field = "EGO Active Above", egoRPM
dialog = westEnrichments, "", yAxis
panel = crankPW
panel = aseSettings
panel = egoSettings
dialog = std_enrichments, "Enrichments", border ; xAxis would work here too, but wanted to give a border example
topicHelp = "helpEnrichments"
panel = westEnrichments, West
panel = accelEnrichments, East
dialog = sparkSettings,"Spark Settings",3
topicHelp = Shelp3
@ -382,15 +375,16 @@
field = "Soft limit max time", SoftLimMax
field = "Hard Rev limit", HardRevLim
; [CurveEditor]
[CurveEditor]
;time-based accel enrichment
curve = time_accel_tpsdot_curve, "TPS based AE"
curve = time_accel_tpsdot_curve, "TPS based AE"
columnLabel = "TPSdot", "Added"
xAxis = 0, 1200, 6
yAxis = 0, 48, 4
xBins = taeRates, TPSdot
yBins = taeBins
;gauge = cltGauge
; curve = warmup_curve, "Warmup Enrichment Curve"
; columnLabel = "Coolant", "WUE %"

View File

@ -220,6 +220,7 @@ void loop()
//***SET STATUSES***
//-----------------------------------------------------------------------------------------------------
currentStatus.TPSlast = currentStatus.TPS;
currentStatus.MAP = map(analogRead(pinMAP), 0, 1023, 0, 100); //Get the current MAP value
currentStatus.tpsADC = map(analogRead(pinTPS), 0, 1023, 0, 255); //Get the current raw TPS ADC value and map it into a byte
currentStatus.TPS = map(currentStatus.tpsADC, configPage1.tpsMin, configPage1.tpsMax, 0, 100); //Take the raw TPS ADC value and convert it into a TPS% based on the calibrated values