From a3aedad3168a56c77efa90c45c68ac66b0b6e237 Mon Sep 17 00:00:00 2001 From: iLeeeZi Date: Thu, 19 Mar 2020 06:27:23 +0200 Subject: [PATCH] Calculate the injector open time in tunerstudio (#319) * Add injector open time calculation option * update calculations dash * better help text * remove option to turn off --- reference/Calculations.dash | 2 +- reference/speeduino.ini | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reference/Calculations.dash b/reference/Calculations.dash index f16c7cd3..af6b4959 100644 --- a/reference/Calculations.dash +++ b/reference/Calculations.dash @@ -1613,7 +1613,7 @@ false 0.0 false - batCorrection + bat_correction diff --git a/reference/speeduino.ini b/reference/speeduino.ini index c093341e..5e726ac4 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -3271,6 +3271,7 @@ cmdtestspk450dc = "E\x03\x0C" gaugeCategory = "Main" ;Name Var Title Units Lo Hi LoD LoW HiW HiD vd ld accelEnrichGauge = accelEnrich, "Accel Enrich", "%", 50, 150, -1, -1, 999, 999, 0, 0 + injOpenGauge = inj_open, "Injector Open Time", "mSec", 0.0, 3.0, 0.0, 0.0, 3.0, 3.0, 3, 3 dutyCycleGauge = dutyCycle, "Duty Cycle", "%", 0, 100, -1, -1, 70, 80, 1, 1 stgDutyCycleGauge = stgDutyCycle, "Staging Duty Cycle", "%", 0, 100, -1, -1, 70, 80, 1, 1 egoCorrGauge = egoCorrection, "EGO Correction", "%", 50, 150, 90, 99, 101, 110, 0, 0 @@ -3283,7 +3284,7 @@ cmdtestspk450dc = "E\x03\x0C" ve2Gauge = VE2, "VE2 (Fuel Table 2)", "%", 0, 120, -1, -1, 999, 999, 0, 0 warmupEnrichGauge = warmupEnrich, "Warmup Enrichment", "%", 100, 200, 130, 140, 140, 150, 0, 0 aseEnrichGauge = ase_enrich, "Afterstart Enrichment","%", 0, 200, 130, 140, 140, 150, 0, 0 - batCorrectGauge = batCorrection, "Voltage Correction", "%", 0, 200, 130, 140, 140, 150, 0, 0 + batCorrectGauge = bat_correction,"Voltage Correction", "%", 0, 200, 130, 140, 140, 150, 0, 0 iatCorrectGauge = airCorrection, "IAT Correction", "%", 0, 200, 130, 140, 140, 150, 0, 0 baroCorrectGauge = baroCorrection,"Baro Correction", "%", 0, 200, 130, 140, 140, 150, 0, 0 flexEnrich = flexFuelCor, "Flex Correction", "%", 0, 200, 130, 140, 140, 150, 0, 0 @@ -3344,7 +3345,6 @@ cmdtestspk450dc = "E\x03\x0C" loopGauge = loopsPerSecond,"Main loop speed", "Loops/S" , 0, 70000, -1, 500,1800, 4000, 0, 0 memoryGauge = freeRAM, "Free memory", "bytes" , 0, 8000, -1, 1000,8000, 1000, 0, 0 reqFuelGauge = req_fuel, "Req. Fuel", "ms", 0, 35.0, 1.0, 1.2, 20, 25, 2, 2 - injOpenGauge = inj_open, "Injector Open Time", "ms", 0, 35.0, 1.0, 1.2, 20, 25, 1, 1 mapMultiplyGauge = map_multiply_amt, "MAP Multiply", "%", 0, 200, 130, 140, 140, 150, 0, 0 nSquirtsGauge = nSquirts, "# Squirts", "", 0, 10, 130, 140, 140, 150, 0, 0 syncLossGauge = syncLossCounter, "# Sync Losses" "", 0, 255, -1, -1, 10, 50, 0, 0 @@ -3539,7 +3539,8 @@ cmdtestspk450dc = "E\x03\x0C" MAPxRPM = { rpm * map } loopsPerRev = { loopsPerSecond / (rpm / 60) } req_fuel = { reqFuel } - inj_open = { injOpen } + bat_correction = { battVCorMode ? 100 : batCorrection } ; If battery voltage correction mode is Whole PW, use the battery correction, otherwise 100% + inj_open = { battVCorMode ? ((injOpen * batCorrection) / 100) : injOpen } ; If battery voltage correction mode is Open Time Only, calculate the corrected open time ase_enrich = { ase ? (100 + asePct ) : 100 } ; If ASE is active then equal the ASE + 100 map_multiply_amt = { multiplyMAP ? map : 100 } ; If multiply MAP is enabled, use the current MAP value, otherwise 100% ;nSquirts = { nCylinders / divider } @@ -3594,7 +3595,7 @@ cmdtestspk450dc = "E\x03\x0C" entry = DFCOOn, "DFCO", int, "%d" entry = egoCorrection, "Gego", int, "%d" entry = airCorrection, "Gair", int, "%d" - entry = batCorrection, "Gbattery", int, "%d" + entry = bat_correction, "Gbattery", int, "%d" entry = warmupEnrich, "Gwarm", int, "%d" entry = baroCorrection, "Gbaro", int, "%d" entry = gammaEnrich, "Gammae", int, "%d"