diff --git a/corrections.ino b/corrections.ino index 0e546fd..b88b36b 100644 --- a/corrections.ino +++ b/corrections.ino @@ -39,10 +39,11 @@ Calculates the % change of the throttle over time (%/second) and performs a look byte correctionAccel() { int rateOfChange = (1000000 / (currentLoopTime - previousLoopTime)) * (currentStatus.TPS - currentStatus.TPSlast); //This is the % per second that the TPS has moved + currentStatus.tpsDOT = rateOfChange / 10; if (rateOfChange > configPage1.tpsThresh) { - return 100 + table2D_getValue(taeTable, rateOfChange); + return 100 + table2D_getValue(taeTable, currentStatus.tpsDOT); } return 100; diff --git a/globals.h b/globals.h index 96f5efd..12b57ed 100644 --- a/globals.h +++ b/globals.h @@ -38,6 +38,7 @@ struct statuses { byte TPS; //The current TPS reading (0% - 100%) byte TPSlast; //The previous TPS reading byte tpsADC; //0-255 byte representation of the TPS + byte tpsDOT; byte VE; byte O2; byte advance; diff --git a/reference/speeduino 0.1.ini b/reference/speeduino 0.1.ini index 5a1b6d9..7b0cd71 100644 --- a/reference/speeduino 0.1.ini +++ b/reference/speeduino 0.1.ini @@ -136,11 +136,11 @@ baroCorr = bits, U08, 118, [3:3], "Off", "On" primePulse = scalar, U08, 119, "ms", 0.1, 0.0, 0.0, 25.5, 1 - egoRPM = scalar, U08, 120, "RPM", 100.0, 0.0, 100, 25500, 0 + egoRPM = scalar, U08, 120, "RPM", 100.0, 0.0, 100, 25500, 0 #if CELSIUS - fastIdleT = scalar, U08, 121, "°C", 0.555, -72.0, -40, 102, 1 + fastIdleT = scalar, U08, 121, "°C", 0.555, -72.0, -40, 102, 1 #else - fastIdleT = scalar, U08, 121, "°F", 1.0, -40.0, -40, 215, 0 + fastIdleT = scalar, U08, 121, "°F", 1.0, -40.0, -40, 215, 0 #endif egoSwitch = scalar, U08, 122, "v", 0.0196, 0.0, 0.0, 5.0, 3 taeColdM = scalar, U08, 123, "%", 1.0, 0.0, 0.0, 250.0, 0 @@ -156,62 +156,64 @@ rpmBins2 = array, U08, 64,[ 8], "RPM", 100.0, 0.0, 100, 25500, 0 #if SPEED_DENSITY - mapBins2 = array, U08, 72, [ 8], "kPa", 1.0, 0.0, 0.0, 255.0, 0 + mapBins2 = array, U08, 72, [ 8], "kPa", 1.0, 0.0, 0.0, 255.0, 0 #elif ALPHA_N - tpsBins2 = array, U08, 72, [ 8], "TPS", 1.0, 0.0, 0.0, 255.0, 0 + tpsBins2 = array, U08, 72, [ 8], "TPS", 1.0, 0.0, 0.0, 255.0, 0 #elif AIR_FLOW_METER #error "MSnS does not support MAF" #exit #endif - TrigAng = scalar, U08, 80, "Deg", 4, 0, 0, 360, 0 - FixAng = scalar, U08, 81, "Deg", 0.352, -28.4, -10, 80, 0 - Trim = scalar, S08, 82, "Deg", 0.352, 0, -45, 45, 0 - CrankAng = scalar, U08, 83, "Deg", 0.352, -28.4, -10, 80, 0 - IgHold = scalar, U08, 84, "", 1, 0, 0, 100, 0 - Trig_plus = bits, U08, 85[0:1], "0", "+22.5", "INVALID", "+45" + TrigAng = scalar, U08, 80, "Deg", 4, 0, 0, 360, 0 + FixAng = scalar, U08, 81, "Deg", 0.352, -28.4, -10, 80, 0 + Trim = scalar, S08, 82, "Deg", 0.352, 0, -45, 45, 0 + CrankAng = scalar, U08, 83, "Deg", 0.352, -28.4, -10, 80, 0 + IgHold = scalar, U08, 84, "", 1, 0, 0, 100, 0 + Trig_plus = bits, U08, 85[0:1], "0", "+22.5", "INVALID", "+45" TrigCrank = bits, U08, 85[2:2], "Trigger Return", "Time Based" - IgInv = bits, U08, 85[3:3], "No", "Yes" - oddfire = bits, U08, 85[4:4], "No", "Yes" - IdleAdv = scalar, U08, 86, "Deg", 0.352,-28.4, -10, 80, 0 - IdleAdvTPS = scalar, U08, 87, "ADC", 1, 0, 0, 255, 0 - IdleAdvRPM = scalar, U08, 88, "RPM", 100, 0, 0, 1200, 0 + IgInv = bits, U08, 85[3:3], "No", "Yes" + oddfire = bits, U08, 85[4:4], "No", "Yes" + IdleAdv = scalar, U08, 86, "Deg", 0.352,-28.4, -10, 80, 0 + IdleAdvTPS = scalar, U08, 87, "ADC", 1, 0, 0, 255, 0 + IdleAdvRPM = scalar, U08, 88, "RPM", 100, 0, 0, 1200, 0 #if CELSIUS - IdleAdvCLT = scalar, U08, 89, "C", 0.555, -72, -40, 102, 1 + IdleAdvCLT = scalar, U08, 89, "C", 0.555, -72, -40, 102, 1 #else - IdleAdvCLT = scalar, U08, 89, "F", 1, -40, -40, 215, 0 + IdleAdvCLT = scalar, U08, 89, "F", 1, -40, -40, 215, 0 #endif - IdleDelayTime = scalar, U08, 90, "sec", 1, 0, 0, 5, 0 - StgCycles = scalar, U08, 91, "cycles", 1, 0, 0, 255, 0 + IdleDelayTime = scalar, U08, 90, "sec", 1, 0, 0, 5, 0 + StgCycles = scalar, U08, 91, "cycles", 1, 0, 0, 255, 0 + ; name = array, type, offset, shape, units, scale, translate, lo, hi, digits + ; name = scalar, type, offset, units, scale, translate, lo, hi, digits ;Dwell control ;running dwell variable railed to 8 - who needs more than 8ms? - dwellcont = bits, U08, 92, [1:1], "Fixed duty*^", "Dwell control" - dwellcrank = scalar, U08, 93, "ms", 0.1, 0, 0, 25, 1 - dwellrun = scalar, U08, 94, "ms", 0.1, 0, 0, 8, 1 - numteeth = scalar, U08, 95, "teeth", 1.0, 0.0, 0.0, 255, 0 - onetwo = scalar, U08, 96, "teeth", 1.0, 0.0, 0.0, 255, 0 + dwellcont = bits, U08, 92, [1:1], "Fixed duty*^", "Dwell control" + dwellcrank = scalar, U08, 93, "ms", 0.1, 0, 0, 25, 1 + dwellrun = scalar, U08, 94, "ms", 0.1, 0, 0, 8, 1 + numteeth = scalar, U08, 95, "teeth", 1.0, 0.0, 0.0, 255, 0 + onetwo = scalar, U08, 96, "teeth", 1.0, 0.0, 0.0, 255, 0 - 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 + crankRPM = scalar, U08, 97, "rpm", 100, 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 + SoftRevLim = scalar, U08, 99, "rpm", 100, 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 ;TPS based acceleration enrichment - taeBins = array, U08, 103, [ 4], "%", 1, 0.00000, 0.00, 255, 0 - taeRates = array, U08, 107, [ 4], "%/s", 1. 0000, 0.00000, 0.00, 255.0, 1 ; 4 bytes - wueRates = array, U08, 111, [ 10], "C", 1.0, 0.0, 100.0, 255.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 + taeBins = array, U08, 103, [ 4], "%/s", 10.0, 0.00000, 0.00, 2550.0, 0 + taeRates = array, U08, 107, [ 4], "%", 1.0, 0.00000, 0.00, 255.0, 0 ; 4 bytes + wueRates = array, U08, 111, [10], "C", 1.0, 0.0, 100.0, 255.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 ;------------------------------------------------------------------------------- @@ -377,8 +379,8 @@ columnLabel = "TPSdot", "Added" xAxis = 0, 1200, 6 yAxis = 0, 48, 4 - xBins = taeRates, TPSdot - yBins = taeBins + xBins = taeBins, TPSdot + yBins = taeRates ;gauge = cltGauge ; curve = warmup_curve, "Warmup Enrichment Curve" @@ -745,7 +747,7 @@ help = helpEnrichments, "Enrichments Help" veCurr = scalar, U08, 18, "%", 1.000, 0.000 blank1 = scalar, U08, 19 ; Raw inputs, as they come from MS. blank2 = scalar, U08, 20 - TPSdot = scalar, U08, 21, "%/s", 1.000, 0.000 + TPSdot = scalar, U08, 21, "%/s", 0.100, 0.000 advance = scalar, U08, 22, "deg", 1.000, 0.000 tps = scalar, U08, 23, "%", 1.000, 0.000 loopsPerSecond = scalar, S16, 24, "loops", 1.000, 0.000