From eb0f928663aeb90057016bde5b8b73d28d9ae2c2 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Fri, 20 Mar 2015 15:13:16 +1100 Subject: [PATCH] Add curve for battery dwell compensation --- globals.h | 15 +++---------- reference/speeduino 0.2.ini | 42 +++++++++++++++---------------------- 2 files changed, 20 insertions(+), 37 deletions(-) diff --git a/globals.h b/globals.h index fa7cd1b9..eb69b704 100644 --- a/globals.h +++ b/globals.h @@ -193,12 +193,8 @@ struct config2 { byte taeValues[4]; //TPS based acceleration enrichment rates (% to add) byte wueBins[10]; //Warmup Enrichment bins (Values are in configTable1) byte dwellLimit; - byte unused122; - byte unused123; - byte unused124; - byte unused125; - byte unused126; - byte unused127; + byte dwellCorrectionValues[6]; //Correction table for dwell vs battery voltage + //Full - All 128bytes of this table are used }; @@ -226,12 +222,7 @@ struct config3 { byte floodClear; //TPS value that triggers flood clear mode (No fuel whilst cranking) byte egoLoadMax; //Load (TPS or MAP) must be below this for closed loop to function byte egoLoadMin; //Load (TPS or MAP) must be above this for closed loop to function - byte unused95; - byte unused96; - byte unused97; - byte unused98; - byte unused99; - byte unused115; + byte dwellCorrectionBins[6]; //Correction table for dwell vs battery voltage byte unused116; byte unused117; byte unused118; diff --git a/reference/speeduino 0.2.ini b/reference/speeduino 0.2.ini index a1d64430..f98fea8c 100644 --- a/reference/speeduino 0.2.ini +++ b/reference/speeduino 0.2.ini @@ -110,7 +110,7 @@ page = 1 displayB1 = bits U08, 104, [0:3], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT" displayB2 = bits U08, 104, [4:7], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT" - + unused105 = scalar, U08, 105, "ms", 0.1, 0.0, 0.0, 25.5, 1 reqFuel = scalar, U08, 106, "ms", 0.1, 0.0, 0.0, 25.5, 1 divider = scalar, U08, 107, "", 1.0, 0.0 @@ -191,6 +191,7 @@ page = 2 ; 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 @@ -207,16 +208,12 @@ page = 2 HardRevLim = scalar, U08, 102, "rpm", 100, 0.0, 100, 25500, 0 ;TPS based acceleration enrichment - 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 + 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 - dwellLim = scalar, U08, 121, "ms", 1, 0, 0, 32, 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 +;Dwell config options + dwellLim = scalar, U08, 121, "ms", 1, 0, 0, 32, 0 + dwellRates = array, U08, 122, [6], "%", 1.0, 0.0, 0.00, 255.0, 0 ;-------------------------------------------------- @@ -254,12 +251,7 @@ page = 3 egoTPSMax = scalar, U08, 92, "%", 1, 0, 0, 120, 0 egoLoadMax = scalar, U08, 93, "%", 1, 0, 0, 120, 0 egoLoadMin = scalar, U08, 94, "%", 1, 0, 0, 120, 0 - unused95 = scalar, U08, 95, "none", 0, 0, 0, 0, 0 - ;unused96 = scalar, U08, 96, "none", 0, 0, 0, 0, 0 - ;unused97 = scalar, U08, 97, "none", 0, 0, 0, 0, 0 - ;unused98 = scalar, U08, 98, "none", 0, 0, 0, 0, 0 - ;unused99 = scalar, U08, 99, "none", 0, 0, 0, 0, 0 - ;unused100 = scalar, U08, 100, "none", 0, 0, 0, 0, 0 + brvBins = array, U08, 95, [6], "V", 1.0, 0, 6, 24, 0 ; Bins for the battery reference voltage ;unused101 = scalar, U08, 101, "none", 0, 0, 0, 0, 0 ;unused102 = scalar, U08, 102, "none", 0, 0, 0, 0, 0 ;unused103 = scalar, U08, 103, "none", 0, 0, 0, 0, 0 @@ -347,6 +339,7 @@ page = 3 ;subMenu = Knock, "Kn&ock System" ;subMenu = IatCltIg, "&IAT/Clt Related Ignition" subMenu = dwellSettings, "Dwell settings" + subMenu = dwell_correction_curve, "Dwell Compensation" ;subMenu = wheelsim, "Stim for wheel" ;subMenu = oddwheel, "Oddfire Wheel settings", 7, { wheelon && oddfire } @@ -543,15 +536,6 @@ page = 3 ;field = "Bar 2", displayB2, { display > 2 } - -; curve = warmup_curve, "Warmup Enrichment Curve" -; columnLabel = "Coolant", "WUE %" -; xAxis = -40, {clthighlim}, 9 -; yAxis = 0, 500, 6 -; xBins = tempTable, coolant -; yBins = wueBins -; gauge = cltGauge - ; ------------------------------------------------------------- ; Help down here help = helpEnrichments, "Enrichments Help" @@ -643,6 +627,14 @@ help = helpEnrichments, "Enrichments Help" xBins = taeBins, TPSdot yBins = taeRates ;gauge = cltGauge + +; Correction curve for dwell vs battery voltage + curve = dwell_correction_curve, "Dwell voltage correction" + columnLabel = "Voltage", "Dwell %" + xAxis = 6, 22, 6 + yAxis = 0, 255, 6 + xBins = brvBins, batteryVoltage + yBins = dwellRates [TableEditor] ; table_id, map3d_id, "title", page