From af13bf72760254e2e3b6814b3e6dfa075111f0ae Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Mon, 17 Aug 2020 09:02:27 +1000 Subject: [PATCH 01/14] REvised layout for the progammable outputs dialog --- reference/speeduino.ini | 153 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 138 insertions(+), 15 deletions(-) diff --git a/reference/speeduino.ini b/reference/speeduino.ini index db2f3587..95da87b7 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -79,7 +79,7 @@ #define fullStatus_def = $fullStatus_def_1, $fullStatus_def_2, $fullStatus_def_3, $fullStatus_def_4 boostTableLabels = bits, U08, [0:1], "Duty Cycle %", "kPa" - prgm_out_selection = bits, U08, [0:7], "1", "2", "3", "4", "5", "6", "7", "8" + prgm_out_selection = bits, U08, [0:2], "1", "2", "3", "4", "5", "6", "7", "8" fuelLoadMax = scalar, U08, "", 1, 0, 0, 511, 0 ignLoadMax = scalar, U08, "", 1, 0, 0, 511, 0 @@ -3620,28 +3620,151 @@ menuDialog = main panel = prgm_out_pin_selection_8 panel = prgm_out_pin_selection_9 - dialog = prgm_out_rules_1_condition_1, "", xAxis + ;Rule 1 + dialog = prgm_out_rules_1_condition_1, "Condition 1", xAxis field = "", firstDataIn0, {outputPin[0]} field = "", firstCompType0, {outputPin[0]} field = "", firstTarget[0], {outputPin[0]} - dialog = prgm_out_rules_1_condition_2, "", xAxis - field = "", bitwise0, {outputPin[0] && bitwise0} + dialog = prgm_out_rules_1_condition_2, "Condition 2", xAxis field = "", secondDataIn0, {outputPin[0] && bitwise0} field = "", secondCompType0, {outputPin[0] && bitwise0} field = "", secondTarget[0], {outputPin[0] && bitwise0} + ;Rule 2 + dialog = prgm_out_rules_2_condition_1, "Condition 1", xAxis + field = "", firstDataIn1, {outputPin[1]} + field = "", firstCompType1, {outputPin[1]} + field = "", firstTarget[1], {outputPin[1]} + dialog = prgm_out_rules_2_condition_2, "Condition 2", xAxis + field = "", secondDataIn1, {outputPin[1] && bitwise1} + field = "", secondCompType1, {outputPin[1] && bitwise1} + field = "", secondTarget[1], {outputPin[1] && bitwise1} + ;Rule 3 + dialog = prgm_out_rules_3_condition_1, "Condition 1", xAxis + field = "", firstDataIn2, {outputPin[2]} + field = "", firstCompType2, {outputPin[2]} + field = "", firstTarget[2], {outputPin[2]} + dialog = prgm_out_rules_3_condition_2, "Condition 2", xAxis + field = "", secondDataIn2, {outputPin[2] && bitwise2} + field = "", secondCompType2, {outputPin[2] && bitwise2} + field = "", secondTarget[2], {outputPin[2] && bitwise2} + ;Rule 4 + dialog = prgm_out_rules_4_condition_1, "Condition 1", xAxis + field = "", firstDataIn3, {outputPin[3]} + field = "", firstCompType3, {outputPin[3]} + field = "", firstTarget[3], {outputPin[3]} + dialog = prgm_out_rules_4_condition_2, "Condition 2", xAxis + field = "", secondDataIn3, {outputPin[3] && bitwise3} + field = "", secondCompType3, {outputPin[3] && bitwise3} + field = "", secondTarget[3], {outputPin[3] && bitwise3} + ;Rule 5 + dialog = prgm_out_rules_5_condition_1, "Condition 1", xAxis + field = "", firstDataIn4, {outputPin[4]} + field = "", firstCompType4, {outputPin[4]} + field = "", firstTarget[4], {outputPin[4]} + dialog = prgm_out_rules_5_condition_2, "Condition 2", xAxis + field = "", secondDataIn4, {outputPin[4] && bitwise4} + field = "", secondCompType4, {outputPin[4] && bitwise4} + field = "", secondTarget[4], {outputPin[4] && bitwise4} + ;Rule 6 + dialog = prgm_out_rules_6_condition_1, "Condition 1", xAxis + field = "", firstDataIn5, {outputPin[5]} + field = "", firstCompType5, {outputPin[5]} + field = "", firstTarget[5], {outputPin[5]} + dialog = prgm_out_rules_6_condition_2, "Condition 2", xAxis + field = "", secondDataIn5, {outputPin[5] && bitwise5} + field = "", secondCompType5, {outputPin[5] && bitwise5} + field = "", secondTarget[5], {outputPin[5] && bitwise5} + ;Rule 7 + dialog = prgm_out_rules_7_condition_1, "Condition 1", xAxis + field = "", firstDataIn6, {outputPin[6]} + field = "", firstCompType6, {outputPin[6]} + field = "", firstTarget[6], {outputPin[6]} + dialog = prgm_out_rules_7_condition_2, "Condition 2", xAxis + field = "", secondDataIn6, {outputPin[6] && bitwise6} + field = "", secondCompType6, {outputPin[6] && bitwise6} + field = "", secondTarget[6], {outputPin[6] && bitwise6} + ;Rule 8 + dialog = prgm_out_rules_8_condition_1, "Condition 1", xAxis + field = "", firstDataIn7, {outputPin[7]} + field = "", firstCompType7, {outputPin[7]} + field = "", firstTarget[7], {outputPin[7]} + dialog = prgm_out_rules_8_condition_2, "Condition 2", xAxis + field = "", secondDataIn7, {outputPin[7] && bitwise7} + field = "", secondCompType7, {outputPin[7] && bitwise7} + field = "", secondTarget[7], {outputPin[7] && bitwise7} dialog = prgm_out_rules_1, "Rule 1", yAxis - field = "Pin Num", outputPin0 - field = "", prgm_out00Alias, {outputPin[0]} - field = "#Condition 1" - panel = prgm_out_rules_1_condition_1 - field = "#Condition 1" + field = "Output Pin Num", outputPin0 + field = "Rule Alias", prgm_out00Alias, {outputPin[0]} + field = "Output Polarity", outputInverted0, {outputPin[0]} + field = "Activation Delay", outputDelay[0], {outputPin[0]} + field = "2nd Condition", bitwise0, {outputPin[0]} panel = prgm_out_rules_1_condition_1 + panel = prgm_out_rules_1_condition_2 - dialog = prgm_out_rules_2, "Rule 2", xAxis - field = "Pin No:" - field = "", outputPin1 + dialog = prgm_out_rules_2, "Rule 2", yAxis + field = "Output Pin Num", outputPin1 + field = "Rule Alias", prgm_out01Alias, {outputPin[1]} + field = "Output Polarity", outputInverted1, {outputPin[1]} + field = "Activation Delay", outputDelay[1], {outputPin[1]} + field = "2nd Condition", bitwise1, {outputPin[1]} + panel = prgm_out_rules_2_condition_1 + panel = prgm_out_rules_2_condition_2 + + dialog = prgm_out_rules_3, "Rule 3", yAxis + field = "Output Pin Num", outputPin2 + field = "Rule Alias", prgm_out02Alias, {outputPin[2]} + field = "Output Polarity", outputInverted2, {outputPin[2]} + field = "Activation Delay", outputDelay[2], {outputPin[2]} + field = "2nd Condition", bitwise2, {outputPin[2]} + panel = prgm_out_rules_3_condition_1 + panel = prgm_out_rules_3_condition_2 + + dialog = prgm_out_rules_4, "Rule 4", yAxis + field = "Output Pin Num", outputPin3 + field = "Rule Alias", prgm_out03Alias, {outputPin[3]} + field = "Output Polarity", outputInverted3, {outputPin[3]} + field = "Activation Delay", outputDelay[3], {outputPin[3]} + field = "2nd Condition", bitwise3, {outputPin[3]} + panel = prgm_out_rules_4_condition_1 + panel = prgm_out_rules_4_condition_2 + + dialog = prgm_out_rules_5, "Rule 5", yAxis + field = "Output Pin Num", outputPin4 + field = "Rule Alias", prgm_out04Alias, {outputPin[4]} + field = "Output Polarity", outputInverted4, {outputPin[4]} + field = "Activation Delay", outputDelay[4], {outputPin[4]} + field = "2nd Condition", bitwise4, {outputPin[4]} + panel = prgm_out_rules_5_condition_1 + panel = prgm_out_rules_5_condition_2 + + dialog = prgm_out_rules_6, "Rule 6", yAxis + field = "Output Pin Num", outputPin5 + field = "Rule Alias", prgm_out05Alias, {outputPin[5]} + field = "Output Polarity", outputInverted5, {outputPin[5]} + field = "Activation Delay", outputDelay[5], {outputPin[5]} + field = "2nd Condition", bitwise5, {outputPin[5]} + panel = prgm_out_rules_6_condition_1 + panel = prgm_out_rules_6_condition_2 + + dialog = prgm_out_rules_7, "Rule 7", yAxis + field = "Output Pin Num", outputPin6 + field = "Rule Alias", prgm_out06Alias, {outputPin[6]} + field = "Output Polarity", outputInverted6, {outputPin[6]} + field = "Activation Delay", outputDelay[6], {outputPin[6]} + field = "2nd Condition", bitwise6, {outputPin[6]} + panel = prgm_out_rules_7_condition_1 + panel = prgm_out_rules_7_condition_2 + + dialog = prgm_out_rules_8, "Rule 8", yAxis + field = "Output Pin Num", outputPin7 + field = "Rule Alias", prgm_out07Alias, {outputPin[7]} + field = "Output Polarity", outputInverted7, {outputPin[7]} + field = "Activation Delay", outputDelay[7], {outputPin[7]} + field = "2nd Condition", bitwise7, {outputPin[7]} + panel = prgm_out_rules_8_condition_1 + panel = prgm_out_rules_8_condition_2 dialog = prgm_out_rules_master, "", card panel = prgm_out_rules_1, Center, { prgm_out_selection == 0 } @@ -3654,9 +3777,9 @@ menuDialog = main panel = prgm_out_rules_8, Center, { prgm_out_selection == 7 } dialog = prgm_out_config, "",yAxis - panel = prgm_out_unique - ;;field = "Rule Number", prgm_out_selection - ;;panel = prgm_out_rules_master + ;panel = prgm_out_unique + field = "Select Rule Number", prgm_out_selection + panel = prgm_out_rules_master ;------------------------------------------------------------------------------- ; General help text From 01298b47474a476799efa7c0f866b24a07adb559 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Mon, 17 Aug 2020 11:25:00 +1000 Subject: [PATCH 02/14] Update tests for new PW calc options --- speeduino/globals.h | 2 +- test/tests/test_misc/test_PW.cpp | 22 +++++++++++++++++++++- test/tests/test_misc/tests_PW.h | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/speeduino/globals.h b/speeduino/globals.h index 0920f9b8..954c4219 100644 --- a/speeduino/globals.h +++ b/speeduino/globals.h @@ -623,7 +623,7 @@ struct config2 { byte battVCorMode : 1; byte SoftLimitMode : 1; byte unused1_3c : 1; - byte aeApplyMode : 1; + byte aeApplyMode : 1; //0 = Multiply | 1 = Add byte multiplyMAP : 2; //0 = off | 1 = baro | 2 = 100 byte wueValues[10]; //Warm up enrichment array (10 bytes) byte crankingPct; //Cranking enrichment diff --git a/test/tests/test_misc/test_PW.cpp b/test/tests/test_misc/test_PW.cpp index 54fb82c4..d7aadb25 100644 --- a/test/tests/test_misc/test_PW.cpp +++ b/test/tests/test_misc/test_PW.cpp @@ -9,6 +9,7 @@ void testPW(void) { RUN_TEST(test_PW_No_Multiply); RUN_TEST(test_PW_MAP_Multiply); + RUN_TEST(test_PW_MAP_Multiply_Compatibility); RUN_TEST(test_PW_AFR_Multiply); RUN_TEST(test_PW_Large_Correction); RUN_TEST(test_PW_Very_Large_Correction); @@ -36,6 +37,7 @@ void test_PW_No_Multiply() configPage2.multiplyMAP = 0; configPage2.includeAFR = 0; configPage2.incorporateAFR = 0; + configPage2.aeApplyMode = 0; uint16_t result = PW(REQ_FUEL, VE, MAP, corrections, injOpen); TEST_ASSERT_UINT16_WITHIN(PW_ALLOWED_ERROR, 2557, result); @@ -46,9 +48,24 @@ void test_PW_MAP_Multiply() test_PW_setCommon(); configPage2.multiplyMAP = 1; - currentStatus.baro = 100; + currentStatus.baro = 103; configPage2.includeAFR = 0; configPage2.incorporateAFR = 0; + configPage2.aeApplyMode = 0; + + uint16_t result = PW(REQ_FUEL, VE, MAP, corrections, injOpen); + TEST_ASSERT_UINT16_WITHIN(PW_ALLOWED_ERROR, 2400, result); +} + +void test_PW_MAP_Multiply_Compatibility() +{ + test_PW_setCommon(); + + configPage2.multiplyMAP = 2; //Divide MAP reading by 100 rather than by Baro reading + currentStatus.baro = 103; + configPage2.includeAFR = 0; + configPage2.incorporateAFR = 0; + configPage2.aeApplyMode = 0; uint16_t result = PW(REQ_FUEL, VE, MAP, corrections, injOpen); TEST_ASSERT_UINT16_WITHIN(PW_ALLOWED_ERROR, 2449, result); @@ -62,6 +79,7 @@ void test_PW_AFR_Multiply() currentStatus.baro = 100; configPage2.includeAFR = 1; configPage2.incorporateAFR = 0; + configPage2.aeApplyMode = 0; configPage6.egoType = 2; //Set O2 sensor type to wideband currentStatus.runSecs = 20; configPage6.ego_sdelay = 10; //Ensure that the run time is longer than the O2 warmup time currentStatus.O2 = 150; @@ -88,6 +106,7 @@ void test_PW_Large_Correction() configPage2.multiplyMAP = 0; configPage2.includeAFR = 0; configPage2.incorporateAFR = 0; + configPage2.aeApplyMode = 0; uint16_t result = PW(REQ_FUEL, VE, MAP, corrections, injOpen); TEST_ASSERT_UINT16_WITHIN(PW_ALLOWED_ERROR, 9268, result); @@ -102,6 +121,7 @@ void test_PW_Very_Large_Correction() configPage2.multiplyMAP = 0; configPage2.includeAFR = 0; configPage2.incorporateAFR = 0; + configPage2.aeApplyMode = 0; uint16_t result = PW(REQ_FUEL, VE, MAP, corrections, injOpen); TEST_ASSERT_UINT16_WITHIN(PW_ALLOWED_ERROR+30, 21670, result); //Additional allowed error here diff --git a/test/tests/test_misc/tests_PW.h b/test/tests/test_misc/tests_PW.h index 64f1a21a..48ab5a17 100644 --- a/test/tests/test_misc/tests_PW.h +++ b/test/tests/test_misc/tests_PW.h @@ -2,6 +2,7 @@ void testPW(); void test_PW_No_Multiply(); void test_PW_MAP_Multiply(void); void test_PW_AFR_Multiply(void); +void test_PW_MAP_Multiply_Compatibility(void); void test_PW_ALL_Multiply(void); void test_PW_Large_Correction(); void test_PW_Very_Large_Correction(); \ No newline at end of file From 194853f9f3d395ba9d06ca92e2d723b609656bf7 Mon Sep 17 00:00:00 2001 From: Pasi Kemppainen <48950874+pazi88@users.noreply.github.com> Date: Tue, 18 Aug 2020 01:54:21 +0300 Subject: [PATCH 03/14] Fix for negative pressure sensor readings (#438) If the pressure sensor readings are negative, this fix will set the value to zero in that case. --- speeduino/sensors.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/speeduino/sensors.ino b/speeduino/sensors.ino index 949b6d18..41c457ee 100644 --- a/speeduino/sensors.ino +++ b/speeduino/sensors.ino @@ -592,7 +592,7 @@ byte getGear() byte getFuelPressure() { - uint16_t tempFuelPressure = 0; + int16_t tempFuelPressure = 0; uint16_t tempReading; if(configPage10.fuelPressureEnable > 0) @@ -605,6 +605,7 @@ byte getFuelPressure() tempFuelPressure = ADC_FILTER(tempFuelPressure, 150, currentStatus.fuelPressure); //Apply speed smoothing factor //Sanity checks if(tempFuelPressure > configPage10.fuelPressureMax) { tempFuelPressure = configPage10.fuelPressureMax; } + if(tempFuelPressure < 0 ) { tempFuelPressure = 0; } //prevent negative values, which will cause problems later when the values aren't signed. } return (byte)tempFuelPressure; @@ -612,7 +613,7 @@ byte getFuelPressure() byte getOilPressure() { - uint16_t tempOilPressure = 0; + int16_t tempOilPressure = 0; uint16_t tempReading; if(configPage10.oilPressureEnable > 0) @@ -626,6 +627,7 @@ byte getOilPressure() tempOilPressure = ADC_FILTER(tempOilPressure, 150, currentStatus.oilPressure); //Apply speed smoothing factor //Sanity check if(tempOilPressure > configPage10.oilPressureMax) { tempOilPressure = configPage10.oilPressureMax; } + if(tempOilPressure < 0 ) { tempOilPressure = 0; } //prevent negative values, which will cause problems later when the values aren't signed. } From 18e608be57d6c70ea5ae3c7e01130e89744a63a9 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Tue, 18 Aug 2020 12:18:30 +1000 Subject: [PATCH 04/14] Add VSS gauge/logging in MPH --- reference/speeduino.ini | 140 +++++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 68 deletions(-) diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 95da87b7..72779731 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -4316,13 +4316,14 @@ cmdVSSratio6 = "E\x99\x06" WMIdutyCycleGauge = wmiPW, "WMI Duty Cycle", "%", 0, 100, -1, -1, 101, 110, 1, 1 gaugeCategory = "Sensor inputs" - mapGauge = map, "Engine MAP", "kPa", 0, {maphigh}, 0, 20, {mapwarn}, {mapdang}, 0, 0 - mapGauge_psi = map_psi, "Engine MAP (PSI)", "PSI", -15, 100, 0, 20, 200, 245, 0, 0 - mapGauge_bar = map_bar, "Engine MAP (BAR)", "Bar", -1, 3, -1, -1, 5, 5, 2, 2 - mapGauge_vacBoost = map_vacboost, "Engine MAP (in-Hg/PSI)", "in-Hg/PSI", -30, 30, -30, -30, 30, 30, 1, 1 - baroGauge = baro, "Baro Pressure", "kPa", 0, {maphigh}, 0, 20, {mapwarn}, {mapdang}, 0, 0 - batteryVoltage = batteryVoltage,"Battery Voltage", "volts", 0, 25, 8, 9, 15, 16, 2, 2 - vssGauge = vss, "Vehicle Speed", "km/h", 0, 250, 5, 10, 180, 200, 0, 0 + mapGauge = map, "Engine MAP", "kPa", 0, {maphigh}, 0, 20, {mapwarn}, {mapdang}, 0, 0 + mapGauge_psi = map_psi, "Engine MAP (PSI)", "PSI", -15, 100, 0, 20, 200, 245, 0, 0 + mapGauge_bar = map_bar, "Engine MAP (BAR)", "Bar", -1, 3, -1, -1, 5, 5, 2, 2 + mapGauge_vacBoost = map_vacboost, "Engine MAP (in-Hg/PSI)", "in-Hg/PSI", -30, 30, -30, -30, 30, 30, 1, 1 + baroGauge = baro, "Baro Pressure", "kPa", 0, {maphigh}, 0, 20, {mapwarn}, {mapdang}, 0, 0 + batteryVoltage = batteryVoltage,"Battery Voltage", "volts", 0, 25, 8, 9, 15, 16, 2, 2 + vssGauge = vss, "Vehicle Speed (kph)", "km/h", 0, 250, 5, 10, 180, 200, 0, 0 + vssGaugeMPH = vssMPH, "Vehicle Speed (mph)", "mph", 0, 250, 5, 10, 180, 200, 0, 0 tpsADCGauge = tpsADC, "TPS ADC", "", 0, 255, -1, -1, 256, 256, 0, 0 throttleGauge = throttle, "Throttle Position", "%TPS", 0, 100, -1, 1, 90, 100, 0, 0 @@ -4613,6 +4614,8 @@ cmdVSSratio6 = "E\x99\x06" map_inhg = { (baro - map) * 0.2953007 } ;in-Hg map_vacboost = { map < baro ? -map_inhg : map_psi } + vssMPH = { vss / 1.60934 } + ;fuelLoadMax = { arrayValue(algorithmLimits , algorithm) } ;Doesn't work, no idea why. fuelLoadMax = { (algorithm == 0 || algorithm == 2) ? 511 : 100 } ignLoadMax = { (ignAlgorithm == 0 || ignAlgorithm == 2) ? 511 : 100 } @@ -4641,67 +4644,68 @@ cmdVSSratio6 = "E\x99\x06" ; Type - Data type of output, converted before writing. ; Format - C-style output format of data. ; - ; Channel Label Type Format - ; -------------- ---------- ----- ------ - entry = time, "Time", float, "%.3f" - entry = secl, "SecL", int, "%d" - entry = rpm, "RPM", int, "%d" - entry = map, "MAP", int, "%d" - entry = MAPxRPM, "MAPxRPM", int, "%d" - entry = tps, "TPS", int, "%d" - entry = afr, "AFR", float, "%.3f" - entry = lambda, "Lambda", float, "%.3f" - entry = iat, "IAT", int, "%d" - entry = coolant, "CLT", int, "%d" - entry = engine, "Engine", int, "%d" - entry = DFCOOn, "DFCO", int, "%d" - entry = egoCorrection, "Gego", int, "%d" - entry = airCorrection, "Gair", int, "%d" - entry = bat_correction, "Gbattery", int, "%d" - entry = warmupEnrich, "Gwarm", int, "%d" - entry = baroCorrection, "Gbaro", int, "%d" - entry = gammaEnrich, "Gammae", int, "%d" - entry = accelEnrich, "Accel Enrich", int, "%d" - entry = veCurr, "Current VE", int, "%d" - entry = VE1, "VE1", int, "%d" - entry = VE2, "VE2", int, "%d" - entry = pulseWidth, "PW", float, "%.3f" - entry = afrTarget, "AFR Target", float, "%.3f" - entry = lambdaTarget, "Lambda Target",float, "%.3f" - entry = pulseWidth, "PW2", float, "%.3f" - entry = dutyCycle, "DutyCycle1", float, "%.1f" - entry = dutyCycle, "DutyCycle2", float, "%.1f" - entry = TPSdot, "TPS DOT", int, "%d" - entry = advance, "Advance", int, "%d" - entry = dwell, "Dwell", float, "%.1f" - entry = batteryVoltage, "Battery V", float, "%.1f" - entry = rpmDOT, "rpm/s", int, "%d" - entry = flex, "Eth %", int, "%d", { flexEnabled } - entry = errorNum, "Error #", int, "%d", { errorNum } - entry = currentError, "Error ID", int, "%d", { errorNum } - entry = map_psi, "Boost PSI", float, "%.1f" - entry = boostTarget, "Boost Target", int, "%d", { boostEnabled } - entry = boostDuty, "Boost Duty", int, "%d", { boostEnabled } - entry = boostCutOut , "Boost cut", int, "%d" - entry = launchHard , "Hard Launch", int, "%d" - entry = hardLimitOn , "Hard Limiter", int, "%d" - entry = idleControlOn, "Idle Control", int, "%d" - entry = idleLoad, "IAC value", int, "%d" - entry = CLIdleTarget, "Idle Target RPM", int, "%%d", { iacAlgorithm == 3 || iacAlgorithm == 5 || idleAdvEnabled >= 1 } ;Only show for closed loop idle modes and if idle advance is enabled - entry = CLIdleDelta, "Idle RPM Delta", int, "%d", { iacAlgorithm == 3 || iacAlgorithm == 5 || idleAdvEnabled >= 1 } ;Only show for closed loop idle modes and if idle advance is enabled - entry = baro, "Baro Pressure",int, "%d" - entry = nitrousOn, "Nitrous", int, "%d", { n2o_enable > 0 } - entry = syncLossCounter, "Sync Loss #", int, "%d" - entry = vvt1Angle, "VVT Angle", int, "%d", { vvtMode == 2 } ;;Only show when using close loop vvt - entry = vvt1Target, "VVT Target Angle", int, "%d", { vvtMode == 2 } ;;Only show when using close loop vvt - entry = vvt1Duty, "VVT Duty", int, "%d", { vvtEnabled > 0 } - entry = vss, "VSS (Speed)", int, "%d", { vssMode > 1 } - entry = gear, "Gear", int, "%d", { vssMode > 1 } - entry = fuelPressure, "Fuel Pressure",int, "%d", { fuelPressureEnable > 0 } - entry = oilPressure, "Oil Pressure", int, "%d", { oilPressureEnable > 0 } - entry = vvt2Angle, "VVT Angle", int, "%d", { vvtMode == 2 } ;;Only show when using close loop vvt - entry = vvt2Target, "VVT Target Angle", int, "%d", { vvtMode == 2 } ;;Only show when using close loop vvt - entry = vvt2Duty, "VVT Duty", int, "%d", { vvtEnabled > 0 } + ; Channel Label Type Format + ; -------------- ---------- ----- ------ + entry = time, "Time", float, "%.3f" + entry = secl, "SecL", int, "%d" + entry = rpm, "RPM", int, "%d" + entry = map, "MAP", int, "%d" + entry = MAPxRPM, "MAPxRPM", int, "%d" + entry = tps, "TPS", int, "%d" + entry = afr, "AFR", float, "%.3f" + entry = lambda, "Lambda", float, "%.3f" + entry = iat, "IAT", int, "%d" + entry = coolant, "CLT", int, "%d" + entry = engine, "Engine", int, "%d" + entry = DFCOOn, "DFCO", int, "%d" + entry = egoCorrection, "Gego", int, "%d" + entry = airCorrection, "Gair", int, "%d" + entry = bat_correction, "Gbattery", int, "%d" + entry = warmupEnrich, "Gwarm", int, "%d" + entry = baroCorrection, "Gbaro", int, "%d" + entry = gammaEnrich, "Gammae", int, "%d" + entry = accelEnrich, "Accel Enrich", int, "%d" + entry = veCurr, "Current VE", int, "%d" + entry = VE1, "VE1", int, "%d" + entry = VE2, "VE2", int, "%d" + entry = pulseWidth, "PW", float, "%.3f" + entry = afrTarget, "AFR Target", float, "%.3f" + entry = lambdaTarget, "Lambda Target", float, "%.3f" + entry = pulseWidth, "PW2", float, "%.3f" + entry = dutyCycle, "DutyCycle1", float, "%.1f" + entry = dutyCycle, "DutyCycle2", float, "%.1f" + entry = TPSdot, "TPS DOT", int, "%d" + entry = advance, "Advance", int, "%d" + entry = dwell, "Dwell", float, "%.1f" + entry = batteryVoltage, "Battery V", float, "%.1f" + entry = rpmDOT, "rpm/s", int, "%d" + entry = flex, "Eth %", int, "%d", { flexEnabled } + entry = errorNum, "Error #", int, "%d", { errorNum } + entry = currentError, "Error ID", int, "%d", { errorNum } + entry = map_psi, "Boost PSI", float, "%.1f" + entry = boostTarget, "Boost Target", int, "%d", { boostEnabled } + entry = boostDuty, "Boost Duty", int, "%d", { boostEnabled } + entry = boostCutOut , "Boost cut", int, "%d" + entry = launchHard , "Hard Launch", int, "%d" + entry = hardLimitOn , "Hard Limiter", int, "%d" + entry = idleControlOn, "Idle Control", int, "%d" + entry = idleLoad, "IAC value", int, "%d" + entry = CLIdleTarget, "Idle Target RPM", int, "%%d", { iacAlgorithm == 3 || iacAlgorithm == 5 || idleAdvEnabled >= 1 } ;Only show for closed loop idle modes and if idle advance is enabled + entry = CLIdleDelta, "Idle RPM Delta", int, "%d", { iacAlgorithm == 3 || iacAlgorithm == 5 || idleAdvEnabled >= 1 } ;Only show for closed loop idle modes and if idle advance is enabled + entry = baro, "Baro Pressure", int, "%d" + entry = nitrousOn, "Nitrous", int, "%d", { n2o_enable > 0 } + entry = syncLossCounter, "Sync Loss #", int, "%d" + entry = vvt1Angle, "VVT Angle", int, "%d", { vvtMode == 2 } ;;Only show when using close loop vvt + entry = vvt1Target, "VVT Target Angle",int, "%d", { vvtMode == 2 } ;;Only show when using close loop vvt + entry = vvt1Duty, "VVT Duty", int, "%d", { vvtEnabled > 0 } + entry = vss, "Wheel Speed (kph)",int, "%d", { vssMode > 1 } + entry = vssMPH, "Wheel Speed (mph)",int, "%d", { vssMode > 1 } + entry = gear, "Gear", int, "%d", { vssMode > 1 } + entry = fuelPressure, "Fuel Pressure", int, "%d", { fuelPressureEnable > 0 } + entry = oilPressure, "Oil Pressure", int, "%d", { oilPressureEnable > 0 } + entry = vvt2Angle, "VVT Angle", int, "%d", { vvtMode == 2 } ;;Only show when using close loop vvt + entry = vvt2Target, "VVT Target Angle",int, "%d", { vvtMode == 2 } ;;Only show when using close loop vvt + entry = vvt2Duty, "VVT Duty", int, "%d", { vvtEnabled > 0 } entry = auxin_gauge0, { stringValue(AUXin00Alias)}, int, "%d", {(caninput_sel0b != 0)} entry = auxin_gauge1, { stringValue(AUXin01Alias)}, int, "%d", { (caninput_sel1b != 0)} From 8e9b680be620a8189253548ef53482456f9c96c8 Mon Sep 17 00:00:00 2001 From: iLeeeZi Date: Tue, 18 Aug 2020 05:34:56 +0300 Subject: [PATCH 05/14] Flex fuel sensor temperature and temperature correction (#413). Also closes #252 * Fuel temperature correction * fix negative temperatures * typo fixed --- reference/speeduino.ini | 32 ++++++++++++++++++++++++++++++-- speeduino/comms.ino | 3 ++- speeduino/corrections.h | 1 + speeduino/corrections.ino | 18 ++++++++++++++++++ speeduino/globals.h | 11 ++++++++++- speeduino/globals.ino | 4 ++++ speeduino/init.ino | 11 +++++++++-- speeduino/logger.h | 6 +++--- speeduino/sensors.h | 9 +++++++++ speeduino/sensors.ino | 14 +++++++++++--- speeduino/timers.ino | 4 ++++ 11 files changed, 101 insertions(+), 12 deletions(-) diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 95da87b7..720fed51 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -1101,8 +1101,16 @@ page = 10 vvtCLminDuty = scalar, U08, 171, "%", 1.0, 0.0, 0.0, 100.0, 0 ; Minimum and maximum duty cycles when using closed loop vvtCLmaxDuty = scalar, U08, 172, "%", 1.0, 0.0, 0.0, 100.0, 0 vvt2Pin = bits , U08, 173, [0:5], "Board Default", "INVALID", "INVALID", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" - unused11_174_191 = array, U08, 174, [18], "RPM", 100.0, 0.0, 100, 25500, 0 + ;Fuel temperature correction + #if CELSIUS + fuelTempBins = array, U08, 174, [6], "C", 1.0, -40, -40, 215, 0 + #else + fuelTempBins = array, U08, 174, [6], "F", 1.8, -22.23, -40, 215, 0 + #endif + fuelTempValues = array, U08, 180, [6], "%", 1.0, 0.0, 0, 255, 0 + + unused11_187_191 = array, U08, 186, [6], "RPM", 100.0, 0.0, 100, 25500, 0 ;Page 11 is the fuel map and axis bins only page = 11 @@ -1527,6 +1535,8 @@ menuDialog = main subMenu = fuelTable2Dialog, "Second fuel Table", 11 subMenu = inj_trimad, "Sequential fuel trim", 9 subMenu = stagingTableDialog, "Staged Injection", 10, { nCylinders <= 4 } ; Can't do staging on more than 4 cylinder engines + subMenu = std_separator + subMenu = fuelTemp_curve, "Fuel Temp Correction", { flexEnabled } menu = "&Spark" subMenu = sparkSettings, "Spark Settings" @@ -3925,6 +3935,14 @@ cmdVSSratio6 = "E\x99\x06" xBins = baroFuelBins, baro yBins = baroFuelValues +; Correction curve for fuel temperature fuel adjustment + curve = fuelTemp_curve, "Fuel temp correction" + columnLabel = "Fuel Temperature", "Fuel Amount" + xAxis = -40, 125, 6 + yAxis = 0, 255, 6 + xBins = fuelTempBins, fuelTemp + yBins = fuelTempValues + ; IAT based ignition timing retard curve = iat_retard_curve, "IAT timing retard" columnLabel = "Inlet Air Temp", "Retard" @@ -4298,6 +4316,7 @@ cmdVSSratio6 = "E\x99\x06" 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 + fuelTempCorGauge = fuelTempCor, "Fuel Temp Correction", "%", 0, 200, 130, 140, 140, 150, 0, 0 advanceGauge = advance, "Spark Advance", "deg BTDC", 50, -10, 0, 0, 35, 45, 0, 0 dwellGauge = dwell, "Ign Dwell", "mSec", 0, 35.0, 1.0, 1.2, 20, 25, 3, 3 boostTargetGauge = boostTarget, "Target Boost", "kPa", 0, {maphigh}, 0, 20, {mapwarn}, {mapdang}, 0, 0 @@ -4334,9 +4353,11 @@ cmdVSSratio6 = "E\x99\x06" #if CELSIUS cltGauge = coolant, "Coolant Temp", "TEMP", -40, 215, -15, 0, 95, 105, 0, 0 iatGauge = iat, "Inlet Air Temp", "TEMP", -40, 215, -15, 0, 95, 100, 0, 0 + fuelTempGauge = fuelTemp, "Fuel Temp", "TEMP", -40, 215, -15, 0, 95, 100, 0, 0 #else cltGauge = coolant, "Coolant Temp", "TEMP", -40, 215, 0, 30, 200, 220, 0, 0 iatGauge = iat, "Inlet Air Temp", "TEMP", -40, 215, 0, 30, 200, 210, 0, 0 + fuelTempGauge = fuelTemp, "Fuel Temp", "TEMP", -40, 215, 0, 30, 200, 210, 0, 0 #endif flexGauge = flex, "Flex sensor", "%", 0, 100, -1, -1, 999, 999, 0, 0 @@ -4437,7 +4458,7 @@ cmdVSSratio6 = "E\x99\x06" ; you change it. ochGetCommand = "r\$tsCanId\x30%2o%2c" - ochBlockSize = 112 + ochBlockSize = 114 secl = scalar, U08, 0, "sec", 1.000, 0.000 status1 = scalar, U08, 1, "bits", 1.000, 0.000 @@ -4568,14 +4589,18 @@ cmdVSSratio6 = "E\x99\x06" outputsStatus5 = bits, U08, 111, [5:5] outputsStatus6 = bits, U08, 111, [6:6] outputsStatus7 = bits, U08, 111, [7:7] + fuelTempRaw = scalar, U08, 112, "°C", 1.000, 0.000 + fuelTempCor = scalar, U08, 113, "%", 1.000, 0.000 #sd_status = scalar, U08, 99, "", 1.0, 0.0 #if CELSIUS coolant = { coolantRaw - 40 } ; Temperature readings are offset by 40 to allow for negatives iat = { iatRaw - 40 } ; Temperature readings are offset by 40 to allow for negatives + fuelTemp = { fuelTempRaw - 40 } ; Temperature readings are offset by 40 to allow for negatives #else coolant = { (coolantRaw - 40) * 1.8 + 32 } ;Convert C to F (Offset by 40) iat = { (iatRaw - 40) * 1.8 + 32 } ;Convert C to F (Offset by 40) + fuelTemp = { (fuelTempRaw - 40) * 1.8 + 32 } ;Convert C to F (Offset by 40) #endif time = { timeNow } seconds = { secl } @@ -4677,6 +4702,9 @@ cmdVSSratio6 = "E\x99\x06" entry = batteryVoltage, "Battery V", float, "%.1f" entry = rpmDOT, "rpm/s", int, "%d" entry = flex, "Eth %", int, "%d", { flexEnabled } + entry = flexFuelCor, "GflexFuel", int, "%d", { flexEnabled } + entry = fuelTemp, "Fuel Temp", int, "%d", { flexEnabled } + entry = fuelTempCor, "GfuelTemp", int, "%d", { flexEnabled } entry = errorNum, "Error #", int, "%d", { errorNum } entry = currentError, "Error ID", int, "%d", { errorNum } entry = map_psi, "Boost PSI", float, "%.1f" diff --git a/speeduino/comms.ino b/speeduino/comms.ino index 9c72c6a1..6b2df4d4 100644 --- a/speeduino/comms.ino +++ b/speeduino/comms.ino @@ -626,6 +626,8 @@ void updateFullStatus() fullStatus[109] = currentStatus.vvt2TargetAngle; fullStatus[110] = currentStatus.vvt2Duty; fullStatus[111] = currentStatus.outputsStatus; + fullStatus[112] = (byte)(currentStatus.fuelTemp + CALIBRATION_TEMPERATURE_OFFSET); //Fuel temperature from flex sensor + fullStatus[113] = currentStatus.fuelTempCorrection; //Fuel temperature Correction (%) } /* This function returns the current values of a fixed group of variables @@ -1890,4 +1892,3 @@ void testComm() Serial.write(1); return; } - diff --git a/speeduino/corrections.h b/speeduino/corrections.h index 0ca70c2e..90155d3c 100644 --- a/speeduino/corrections.h +++ b/speeduino/corrections.h @@ -15,6 +15,7 @@ uint16_t correctionAccel(); //Acceleration Enrichment byte correctionFloodClear(); //Check for flood clear on cranking byte correctionAFRClosedLoop(); //Closed loop AFR adjustment byte correctionFlex(); //Flex fuel adjustment +byte correctionFuelTemp(); //Fuel temp correction byte correctionBatVoltage(); //Battery voltage correction byte correctionIATDensity(); //Inlet temp density correction byte correctionBaro(); //Barometric pressure correction diff --git a/speeduino/corrections.ino b/speeduino/corrections.ino index c8bce824..a5b487a6 100644 --- a/speeduino/corrections.ino +++ b/speeduino/corrections.ino @@ -102,6 +102,10 @@ uint16_t correctionsFuel() if (currentStatus.flexCorrection != 100) { sumCorrections = (sumCorrections * currentStatus.flexCorrection); activeCorrections++; } if (activeCorrections == MAX_CORRECTIONS) { sumCorrections = sumCorrections / powint(100,activeCorrections); activeCorrections = 0; } + currentStatus.fuelTempCorrection = correctionFuelTemp(); + if (currentStatus.fuelTempCorrection != 100) { sumCorrections = (sumCorrections * currentStatus.fuelTempCorrection); activeCorrections++; } + if (activeCorrections == MAX_CORRECTIONS) { sumCorrections = sumCorrections / powint(100,activeCorrections); activeCorrections = 0; } + currentStatus.launchCorrection = correctionLaunch(); if (currentStatus.launchCorrection != 100) { sumCorrections = (sumCorrections * currentStatus.launchCorrection); activeCorrections++; } @@ -521,6 +525,20 @@ byte correctionFlex() return flexValue; } +/* + * Fuel temperature adjustment to vary fuel based on fuel temperature reading +*/ +byte correctionFuelTemp() +{ + byte fuelTempValue = 100; + + if (configPage2.flexEnabled == 1) + { + fuelTempValue = table2D_getValue(&fuelTempTable, currentStatus.fuelTemp + CALIBRATION_TEMPERATURE_OFFSET); + } + return fuelTempValue; +} + /* Lookup the AFR target table and perform either a simple or PID adjustment based on this diff --git a/speeduino/globals.h b/speeduino/globals.h index 954c4219..4b06f705 100644 --- a/speeduino/globals.h +++ b/speeduino/globals.h @@ -371,6 +371,7 @@ extern struct table2D rotarySplitTable; //8 bin ignition split curve for rotary extern struct table2D flexFuelTable; //6 bin flex fuel correction table for fuel adjustments (2D) extern struct table2D flexAdvTable; //6 bin flex fuel correction table for timing advance (2D) extern struct table2D flexBoostTable; //6 bin flex fuel correction table for boost adjustments (2D) +extern struct table2D fuelTempTable; //6 bin fuel temperature correction table for fuel adjustments (2D) extern struct table2D knockWindowStartTable; extern struct table2D knockWindowDurationTable; extern struct table2D oilPressureProtectTable; @@ -416,6 +417,9 @@ extern volatile PINMASK_TYPE tach_pin_mask; extern volatile PORT_TYPE *pump_pin_port; extern volatile PINMASK_TYPE pump_pin_mask; +extern volatile PORT_TYPE *flex_pin_port; +extern volatile PINMASK_TYPE flex_pin_mask; + extern volatile PORT_TYPE *triggerPri_pin_port; extern volatile PINMASK_TYPE triggerPri_pin_mask; extern volatile PORT_TYPE *triggerSec_pin_port; @@ -537,6 +541,7 @@ struct statuses { byte baroCorrection; /**< The amount of correction being applied for the current baro reading */ byte launchCorrection; /**< The amount of correction being applied if launch control is active */ byte flexCorrection; /**< Amount of correction being applied to compensate for ethanol content */ + byte fuelTempCorrection; /**< Amount of correction being applied to compensate for fuel temperature */ int8_t flexIgnCorrection; /**< Amount of additional advance being applied based on flex. Note the type as this allows for negative values */ byte afrTarget; byte idleDuty; /**< The current idle duty cycle amount if PWM idle is selected and active */ @@ -545,6 +550,7 @@ struct statuses { bool CTPSActive; /**< Whether the externally controlled closed throttle position sensor is currently active */ bool fanOn; /**< Whether or not the fan is turned on */ volatile byte ethanolPct; /**< Ethanol reading (if enabled). 0 = No ethanol, 100 = pure ethanol. Eg E85 = 85. */ + volatile int8_t fuelTemp; unsigned long AEEndTime; /**< The target end time used whenever AE is turned on */ volatile byte status1; volatile byte spark; @@ -1186,7 +1192,10 @@ struct config10 { byte unused11_174_1 : 1; byte unused11_174_2 : 1; - byte unused11_175_191[18]; //Bytes 175-191 + byte fuelTempBins[6]; + byte fuelTempValues[6]; + + byte unused11_187_191[6]; //Bytes 187-191 #if defined(CORE_AVR) }; diff --git a/speeduino/globals.ino b/speeduino/globals.ino index b2e83a58..88e0c470 100644 --- a/speeduino/globals.ino +++ b/speeduino/globals.ino @@ -37,6 +37,7 @@ struct table2D rotarySplitTable; //8 bin ignition split curve for rotary leading struct table2D flexFuelTable; //6 bin flex fuel correction table for fuel adjustments (2D) struct table2D flexAdvTable; //6 bin flex fuel correction table for timing advance (2D) struct table2D flexBoostTable; //6 bin flex fuel correction table for boost adjustments (2D) +struct table2D fuelTempTable; //6 bin flex fuel correction table for fuel adjustments (2D) struct table2D knockWindowStartTable; struct table2D knockWindowDurationTable; struct table2D oilPressureProtectTable; @@ -82,6 +83,9 @@ volatile PINMASK_TYPE tach_pin_mask; volatile PORT_TYPE *pump_pin_port; volatile PINMASK_TYPE pump_pin_mask; +volatile PORT_TYPE *flex_pin_port; +volatile PINMASK_TYPE flex_pin_mask; + volatile PORT_TYPE *triggerPri_pin_port; volatile PINMASK_TYPE triggerPri_pin_mask; volatile PORT_TYPE *triggerSec_pin_port; diff --git a/speeduino/init.ino b/speeduino/init.ino index 1d542177..f5e811ce 100644 --- a/speeduino/init.ino +++ b/speeduino/init.ino @@ -163,6 +163,11 @@ void initialiseAll() flexBoostTable.xSize = 6; flexBoostTable.values = configPage10.flexBoostAdj; flexBoostTable.axisX = configPage10.flexBoostBins; + fuelTempTable.valueSize = SIZE_BYTE; + fuelTempTable.axisSize = SIZE_BYTE; //Set this table to use byte axis bins + fuelTempTable.xSize = 6; + fuelTempTable.values = configPage10.fuelTempValues; + fuelTempTable.axisX = configPage10.fuelTempBins; knockWindowStartTable.valueSize = SIZE_BYTE; knockWindowStartTable.axisSize = SIZE_BYTE; //Set this table to use byte axis bins @@ -294,10 +299,10 @@ void initialiseAll() } } - //Check whether the flex sensor is enabled and if so, attach an interupt for it + //Check whether the flex sensor is enabled and if so, attach an interrupt for it if(configPage2.flexEnabled > 0) { - attachInterrupt(digitalPinToInterrupt(pinFlex), flexPulse, RISING); + attachInterrupt(digitalPinToInterrupt(pinFlex), flexPulse, CHANGE); currentStatus.ethanolPct = 0; } //Same as above, but for the VSS input @@ -2580,6 +2585,8 @@ void setPinMapping(byte boardID) triggerPri_pin_mask = digitalPinToBitMask(pinTrigger); triggerSec_pin_port = portInputRegister(digitalPinToPort(pinTrigger2)); triggerSec_pin_mask = digitalPinToBitMask(pinTrigger2); + flex_pin_port = portInputRegister(digitalPinToPort(pinFlex)); + flex_pin_mask = digitalPinToBitMask(pinFlex); } diff --git a/speeduino/logger.h b/speeduino/logger.h index cbeee941..14d1e876 100644 --- a/speeduino/logger.h +++ b/speeduino/logger.h @@ -9,10 +9,10 @@ #ifndef LOGGER_H #define LOGGER_H -#define LOG_ENTRY_SIZE 112 /**< The size of the live data packet. This MUST match ochBlockSize setting in the ini file */ -#define SD_LOG_ENTRY_SIZE 112 /**< The size of the live data packet used by the SD car.*/ +#define LOG_ENTRY_SIZE 114 /**< The size of the live data packet. This MUST match ochBlockSize setting in the ini file */ +#define SD_LOG_ENTRY_SIZE 114 /**< The size of the live data packet used by the SD car.*/ void createLog(uint8_t *array); void createSDLog(uint8_t *array); -#endif \ No newline at end of file +#endif diff --git a/speeduino/sensors.h b/speeduino/sensors.h index 3973e6d4..0912f6e8 100644 --- a/speeduino/sensors.h +++ b/speeduino/sensors.h @@ -31,6 +31,15 @@ */ volatile byte flexCounter = 0; +volatile unsigned long flexStartTime; +volatile unsigned long flexPulseWidth; + +#if defined(CORE_AVR) + #define READ_FLEX() ((*flex_pin_port & flex_pin_mask) ? true : false) +#else + #define READ_FLEX() digitalRead(pinFlex) +#endif + volatile byte knockCounter = 0; volatile uint16_t knockAngle; diff --git a/speeduino/sensors.ino b/speeduino/sensors.ino index 41c457ee..01dd3515 100644 --- a/speeduino/sensors.ino +++ b/speeduino/sensors.ino @@ -635,12 +635,20 @@ byte getOilPressure() } /* - * The interrupt function for reading the flex sensor frequency - * This value is incremented with every pulse and reset back to 0 once per second + * The interrupt function for reading the flex sensor frequency and pulse width + * flexCounter value is incremented with every pulse and reset back to 0 once per second */ void flexPulse() { - ++flexCounter; + if(READ_FLEX() == true) + { + flexPulseWidth = (micros() - flexStartTime); //Calculate the pulse width + ++flexCounter; + } + else + { + flexStartTime = micros(); //Start pulse width measurement. + } } /* diff --git a/speeduino/timers.ino b/speeduino/timers.ino index 5c786d62..de1bfe20 100644 --- a/speeduino/timers.ino +++ b/speeduino/timers.ino @@ -227,6 +227,10 @@ void oneMSInterval() //Most ARM chips can simply call a function //Off by 1 error check if (currentStatus.ethanolPct == 1) { currentStatus.ethanolPct = 0; } + //Continental flex sensor fuel temperature can be read with following formula: (Temperature = (41.25 * pulse width(ms)) - 81.25). 1000μs = -40C and 5000μs = 125C + if(flexPulseWidth > 5000) { flexPulseWidth = 5000; } + else if(flexPulseWidth < 1000) { flexPulseWidth = 1000; } + currentStatus.fuelTemp = (((4224 * (long)flexPulseWidth) >> 10) - 8125) / 100; } //************************************************************************************************************************************************** From c2558fa4a1255cd577af5068da01fa08e442da76 Mon Sep 17 00:00:00 2001 From: Pasi Kemppainen <48950874+pazi88@users.noreply.github.com> Date: Tue, 18 Aug 2020 07:51:32 +0300 Subject: [PATCH 06/14] Bug fix and small improvement for local aux input channels (#398) * Add config error indicator * Fixes and naming change * Fixes * Change to fix conflicting error bit flag in init * Updating IO flag setting Co-authored-by: Pasi Kemppainen Co-authored-by: Josh Stewart --- reference/speeduino.ini | 4 +++- speeduino/globals.h | 3 ++- speeduino/init.ino | 1 + speeduino/sensors.ino | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 720fed51..37cafc54 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -4433,6 +4433,7 @@ cmdVSSratio6 = "E\x99\x06" indicator = { resetLockOn }, "Reset Lock OFF","Reset Lock ON", red, black, green, black indicator = { bootloaderCaps > 0 }, "Std. Boot", "Custom Boot", white, black, white, black indicator = { nitrousOn }, "Nitrous Off", "Nitrous On", white, black, red, black + indicator = { IOError }, "I/O Ok", "I/O Error!", white, black, red, black ;Engine Protection status indicators indicator = { engineProtectStatus}, "Engine Protect OFF", "Engine Protect ON", white, black, red, black indicator = { engineProtectRPM }, "Rev Limiter Off", "Rev Limiter ON", white, black, red, black @@ -4557,7 +4558,8 @@ cmdVSSratio6 = "E\x99\x06" engineProtectMAP = bits, U08, 84, [1:1] engineProtectOil = bits, U08, 84, [2:2] engineProtectAFR = bits, U08, 84, [3:3] - engineProtectOth = bits, U08, 84, [4:7] ; Unused for now + engineProtectOth = bits, U08, 84, [4:6] ; Unused for now + IOError = bits, U08, 84, [7:7] unused1 = scalar, U08, 84, "ADC",1.000, 0.000 fuelLoad = scalar, S16, 85, { bitStringValue( algorithmUnits , algorithm ) }, 1.000, 0.000 ignLoad = scalar, S16, 87, { bitStringValue( algorithmUnits , ignAlgorithm ) }, 1.000, 0.000 diff --git a/speeduino/globals.h b/speeduino/globals.h index 4b06f705..caed2535 100644 --- a/speeduino/globals.h +++ b/speeduino/globals.h @@ -241,6 +241,7 @@ #define PROTECT_CUT_IGN 1 #define PROTECT_CUT_FUEL 2 #define PROTECT_CUT_BOTH 3 +#define PROTECT_IO_ERROR 7 #define AE_MODE_TPS 0 #define AE_MODE_MAP 1 @@ -495,8 +496,8 @@ extern volatile byte LOOP_TIMER; #define pinIsInjector(pin) ( ((pin) == pinInjector1) || ((pin) == pinInjector2) || ((pin) == pinInjector3) || ((pin) == pinInjector4) || ((pin) == pinInjector5) || ((pin) == pinInjector6) || ((pin) == pinInjector7) || ((pin) == pinInjector8) ) #define pinIsIgnition(pin) ( ((pin) == pinCoil1) || ((pin) == pinCoil2) || ((pin) == pinCoil3) || ((pin) == pinCoil4) || ((pin) == pinCoil5) || ((pin) == pinCoil6) || ((pin) == pinCoil7) || ((pin) == pinCoil8) ) #define pinIsSensor(pin) ( ((pin) == pinCLT) || ((pin) == pinIAT) || ((pin) == pinMAP) || ((pin) == pinTPS) || ((pin) == pinO2) || ((pin) == pinBat) ) -#define pinIsUsed(pin) ( pinIsInjector((pin)) || pinIsIgnition((pin)) || pinIsSensor((pin)) ) #define pinIsOutput(pin) ( ((pin) == pinFuelPump) || ((pin) == pinFan) || ((pin) == pinVVT_1) || ((pin) == pinVVT_2) || ((pin) == pinBoost) || ((pin) == pinIdle1) || ((pin) == pinIdle2) || ((pin) == pinTachOut) ) +#define pinIsUsed(pin) ( pinIsInjector((pin)) || pinIsIgnition((pin)) || pinIsSensor((pin)) || pinIsOutput((pin)) ) //The status struct contains the current values for all 'live' variables //In current version this is 64 bytes diff --git a/speeduino/init.ino b/speeduino/init.ino index f5e811ce..0e0e375f 100644 --- a/speeduino/init.ino +++ b/speeduino/init.ino @@ -265,6 +265,7 @@ void initialiseAll() initialiseFan(); initialiseAuxPWM(); initialiseCorrections(); + BIT_CLEAR(currentStatus.engineProtectStatus, PROTECT_IO_ERROR); //Clear the I/O error bit. The bit will be set in initialiseADC() if there is problem in there. initialiseADC(); initialiseProgrammableIO(); diff --git a/speeduino/sensors.ino b/speeduino/sensors.ino index 01dd3515..417b2dda 100644 --- a/speeduino/sensors.ino +++ b/speeduino/sensors.ino @@ -76,7 +76,7 @@ void initialiseADC() if( pinIsUsed(pinNumber) ) { //Do nothing here as the pin is already in use. - //Need some method of reporting this back to the user + BIT_SET(currentStatus.engineProtectStatus, PROTECT_IO_ERROR); //Tell user that there is problem by lighting up the I/O error indicator } else { @@ -94,7 +94,7 @@ void initialiseADC() if( pinIsUsed(pinNumber) ) { //Do nothing here as the pin is already in use. - //Need some method of reporting this back to the user + BIT_SET(currentStatus.engineProtectStatus, PROTECT_IO_ERROR); //Tell user that there is problem by lighting up the I/O error indicator } else { From 7c3db9b7dfbeedc5cf4c4e18cf0b916ac67da648 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Thu, 20 Aug 2020 16:58:44 +1000 Subject: [PATCH 07/14] Fix for programmable outputs not funcitoning --- reference/speeduino.ini | 37 +++++++++++++++++++------------------ speeduino/globals.h | 5 +++-- speeduino/speeduino.ino | 1 + speeduino/utils.h | 2 +- speeduino/utils.ino | 20 ++++++++++++-------- 5 files changed, 36 insertions(+), 29 deletions(-) diff --git a/reference/speeduino.ini b/reference/speeduino.ini index e1fbaf93..6901595e 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -1151,24 +1151,25 @@ page = 13 outputPin6 = bits U08, 8, [0:7], $comp_IO_Pins outputPin7 = bits U08, 9, [0:7], $comp_IO_Pins outputDelay = array, U08, 10, [ 8], "S", 0.1, 0.0, 0.0, 25.5, 1 - firstDataIn = array, U16, 18, [ 8], "", 1.0, 0.0, 0.0, 65535.0, 0 - firstDataIn0= bits U16, 18, [0:7], $fullStatus_def - firstDataIn1= bits U16, 20, [0:7], $fullStatus_def - firstDataIn2= bits U16, 22, [0:7], $fullStatus_def - firstDataIn3= bits U16, 24, [0:7], $fullStatus_def - firstDataIn4= bits U16, 26, [0:7], $fullStatus_def - firstDataIn5= bits U16, 28, [0:7], $fullStatus_def - firstDataIn6= bits U16, 30, [0:7], $fullStatus_def - firstDataIn7= bits U16, 32, [0:7], $fullStatus_def - secondDataIn = array, U16, 34, [ 8], "", 1.0, 0.0, 0.0, 65535.0, 0 - secondDataIn0= bits U16, 34, [0:7], $fullStatus_def - secondDataIn1= bits U16, 36, [0:7], $fullStatus_def - secondDataIn2= bits U16, 38, [0:7], $fullStatus_def - secondDataIn3= bits U16, 40, [0:7], $fullStatus_def - secondDataIn4= bits U16, 42, [0:7], $fullStatus_def - secondDataIn5= bits U16, 44, [0:7], $fullStatus_def - secondDataIn6= bits U16, 46, [0:7], $fullStatus_def - secondDataIn7= bits U16, 48, [0:7], $fullStatus_def + firstDataIn = array, U08, 18, [ 8], "", 1.0, 0.0, 0.0, 65535.0, 0 + firstDataIn0= bits U08, 18, [0:7], $fullStatus_def + firstDataIn1= bits U08, 19, [0:7], $fullStatus_def + firstDataIn2= bits U08, 20, [0:7], $fullStatus_def + firstDataIn3= bits U08, 21, [0:7], $fullStatus_def + firstDataIn4= bits U08, 22, [0:7], $fullStatus_def + firstDataIn5= bits U08, 23, [0:7], $fullStatus_def + firstDataIn6= bits U08, 24, [0:7], $fullStatus_def + firstDataIn7= bits U08, 25, [0:7], $fullStatus_def + secondDataIn = array, U08, 26, [ 8], "", 1.0, 0.0, 0.0, 65535.0, 0 + secondDataIn0= bits U08, 27, [0:7], $fullStatus_def + secondDataIn1= bits U08, 28, [0:7], $fullStatus_def + secondDataIn2= bits U08, 29, [0:7], $fullStatus_def + secondDataIn3= bits U08, 30, [0:7], $fullStatus_def + secondDataIn4= bits U08, 31, [0:7], $fullStatus_def + secondDataIn5= bits U08, 32, [0:7], $fullStatus_def + secondDataIn6= bits U08, 33, [0:7], $fullStatus_def + secondDataIn7= bits U08, 34, [0:7], $fullStatus_def + unused13_35_49 = array, U08, 35, [ 16] "%", 1.0, 0.0, 0.0, 100.0, 0 firstTarget = array, S16, 50, [ 8], "", 1.0, 0.0, -32768.0, 32768.0, 0 secondTarget = array, S16, 66, [ 8], "", 1.0, 0.0, -32768.0, 32768.0, 0 firstCompType0 = bits, U08, 82, [0:2], $comparator_def diff --git a/speeduino/globals.h b/speeduino/globals.h index caed2535..0b6fc19f 100644 --- a/speeduino/globals.h +++ b/speeduino/globals.h @@ -1219,8 +1219,9 @@ struct config13 { uint8_t unused12_1; uint8_t outputPin[8]; uint8_t outputDelay[8]; //0.1S - uint16_t firstDataIn[8]; - uint16_t secondDataIn[8]; + uint8_t firstDataIn[8]; + uint8_t secondDataIn[8]; + uint8_t unused_13[16]; int16_t firstTarget[8]; int16_t secondTarget[8]; //89bytes diff --git a/speeduino/speeduino.ino b/speeduino/speeduino.ino index 9ea26acc..3c545fbe 100644 --- a/speeduino/speeduino.ino +++ b/speeduino/speeduino.ino @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "storage.h" #include "crankMaths.h" #include "init.h" +#include "utils.h" #include "engineProtection.h" #include BOARD_H //Note that this is not a real file, it is defined in globals.h. diff --git a/speeduino/utils.h b/speeduino/utils.h index 9ae770c5..f69a3812 100644 --- a/speeduino/utils.h +++ b/speeduino/utils.h @@ -22,7 +22,7 @@ These are some utility functions and variables used through the main code #define BITWISE_XOR 3 uint16_t ioDelay[sizeof(configPage13.outputPin)]; -uint8_t outputPin[sizeof(configPage13.outputPin)]; +//uint8_t outputPin[sizeof(configPage13.outputPin)]; void setResetControlPinState(); byte pinTranslate(byte); diff --git a/speeduino/utils.ino b/speeduino/utils.ino index 4879d8e9..81776dbd 100644 --- a/speeduino/utils.ino +++ b/speeduino/utils.ino @@ -205,11 +205,10 @@ void initialiseProgrammableIO() { for (uint8_t y = 0; y < sizeof(configPage13.outputPin); y++) { - if (outputPin[y] < BOARD_NR_GPIO_PINS) { outputPin[y] = configPage13.outputPin[y]; } - if ( (outputPin[y] > 0) && (outputPin[y] < BOARD_NR_GPIO_PINS) ) + if ( (configPage13.outputPin[y] > 0) && (configPage13.outputPin[y] < BOARD_NR_GPIO_PINS) ) { - pinMode(outputPin[y], OUTPUT); - digitalWrite(outputPin[y], (configPage13.outputInverted & (1U << y))); + pinMode(configPage13.outputPin[y], OUTPUT); + digitalWrite(configPage13.outputPin[y], (configPage13.outputInverted & (1U << y))); } } } @@ -223,8 +222,9 @@ void checkProgrammableIO() { firstCheck = false; secondCheck = false; - if ( outputPin[y] > 0 ) //if outputPin == 0 it is disabled - { + if ( configPage13.outputPin[y] > 0 ) //if outputPin == 0 it is disabled + { + //byte theIndex = configPage13.firstDataIn[y]; data = ProgrammableIOGetData(configPage13.firstDataIn[y]); data2 = configPage13.firstTarget[y]; @@ -254,18 +254,19 @@ void checkProgrammableIO() if (configPage13.operation[y].bitwise == BITWISE_XOR) { firstCheck ^= secondCheck; } } } + if ( (firstCheck == true) && (configPage13.outputDelay[y] != 0) && (configPage13.outputDelay[y] < 255) ) { if ( (ioDelay[y] >= configPage13.outputDelay[y]) ) { - if (outputPin[y] <= 128) { digitalWrite(outputPin[y], (configPage13.outputInverted & (1U << y)) ^ firstCheck); } + if (configPage13.outputPin[y] <= 128) { digitalWrite(configPage13.outputPin[y], (configPage13.outputInverted & (1U << y)) ^ firstCheck); } } else { ioDelay[y]++; } } else { - if ( outputPin[y] <= 128 ) { digitalWrite(outputPin[y], (configPage13.outputInverted & (1U << y)) ^ firstCheck); } + if ( configPage13.outputPin[y] <= 128 ) { digitalWrite(configPage13.outputPin[y], (configPage13.outputInverted & (1U << y)) ^ firstCheck); } if ( firstCheck == false ) { ioDelay[y] = 0; } } if ( firstCheck == true ) { BIT_SET(currentStatus.outputsStatus, y); } @@ -287,6 +288,9 @@ int16_t ProgrammableIOGetData(uint16_t index) } if (x >= sizeof(fsIntIndex)) { result = fullStatus[index]; } else { result = word(fullStatus[index+1], fullStatus[index]); } + + //Special cases for temperatures + if( (index == 6) || (index == 7) ) { result -= CALIBRATION_TEMPERATURE_OFFSET; } } else { result = -1; } //Index is bigger than fullStatus array return result; From 1b08b5f85b24344701594d3480c2e1da618a9d19 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Sat, 22 Aug 2020 19:05:50 +1000 Subject: [PATCH 08/14] Add ability to change the fixed resolution of the table interp calculation. --- speeduino/table.h | 4 ++++ speeduino/table.ino | 24 +++++++++--------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/speeduino/table.h b/speeduino/table.h index 64c7dde4..0de228bb 100644 --- a/speeduino/table.h +++ b/speeduino/table.h @@ -7,6 +7,10 @@ This file is used for everything related to maps/tables including their definiti #define TABLE_RPM_MULTIPLIER 100 #define TABLE_LOAD_MULTIPLIER 2 +//The shift amount used for the 3D table calculations +#define TABLE_SHIFT_FACTOR 8 +#define TABLE_SHIFT_POWER (1UL<> 8; - int n = (p * (256-q)) >> 8; - int o = ((256-p) * q) >> 8; - int r = (p * q) >> 8; - tableResult = ( (A * m) + (B * n) + (C * o) + (D * r) ) >> 8; + uint32_t m = ((TABLE_SHIFT_POWER-p) * (TABLE_SHIFT_POWER-q)) >> TABLE_SHIFT_FACTOR; + uint32_t n = (p * (TABLE_SHIFT_POWER-q)) >> TABLE_SHIFT_FACTOR; + uint32_t o = ((TABLE_SHIFT_POWER-p) * q) >> TABLE_SHIFT_FACTOR; + uint32_t r = (p * q) >> TABLE_SHIFT_FACTOR; + tableResult = ( (A * m) + (B * n) + (C * o) + (D * r) ) >> TABLE_SHIFT_FACTOR; } //Update the tables cache data From 867eba45b6b16bb7f9f690a42de30d50da0e9f4f Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Sat, 22 Aug 2020 19:06:14 +1000 Subject: [PATCH 09/14] Disable all programmable outputs in updates.ino --- speeduino/updates.ino | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/speeduino/updates.ino b/speeduino/updates.ino index 7244eb9b..71d0b429 100644 --- a/speeduino/updates.ino +++ b/speeduino/updates.ino @@ -408,6 +408,16 @@ void doUpdates() configPage10.wmiAdvAdj[i] = OFFSET_IGNITION; } + //Programmable outputs added. Set all to disabled + configPage13.outputPin[0] = 0; + configPage13.outputPin[1] = 0; + configPage13.outputPin[2] = 0; + configPage13.outputPin[3] = 0; + configPage13.outputPin[4] = 0; + configPage13.outputPin[5] = 0; + configPage13.outputPin[6] = 0; + configPage13.outputPin[7] = 0; + //New multiply MAP option added. Set new option to be the same as old configPage2.multiplyMAP = configPage2.multiplyMAP_old; //New AE option added to allow for PW added in addition to existing PW multiply From e783d1513879f0b0569111070a818fe731a410b7 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Sat, 22 Aug 2020 20:53:42 +1000 Subject: [PATCH 10/14] Add tx buffer check for tooth and composite logs --- speeduino/TS_CommandButtonHandler.ino | 2 +- speeduino/cancomms.ino | 2 +- speeduino/comms.h | 6 +++-- speeduino/comms.ino | 35 ++++++++++++++++++++------ speeduino/init.ino | 2 +- speeduino/speeduino.ino | 12 ++++++++- speeduino/{utils.h => utilities.h} | 0 speeduino/{utils.ino => utilities.ino} | 2 +- 8 files changed, 46 insertions(+), 15 deletions(-) rename speeduino/{utils.h => utilities.h} (100%) rename speeduino/{utils.ino => utilities.ino} (99%) diff --git a/speeduino/TS_CommandButtonHandler.ino b/speeduino/TS_CommandButtonHandler.ino index 9cece067..e01bb4c4 100644 --- a/speeduino/TS_CommandButtonHandler.ino +++ b/speeduino/TS_CommandButtonHandler.ino @@ -6,7 +6,7 @@ #include "TS_CommandButtonHandler.h" #include "globals.h" -#include "utils.h" +#include "utilities.h" #include "scheduledIO.h" #include "sensors.h" #include "storage.h" diff --git a/speeduino/cancomms.ino b/speeduino/cancomms.ino index 6157b9af..96ae17a1 100644 --- a/speeduino/cancomms.ino +++ b/speeduino/cancomms.ino @@ -19,7 +19,7 @@ sendcancommand is called when a command is to be sent either to serial3 #include "cancomms.h" #include "maths.h" #include "errors.h" -#include "utils.h" +#include "utilities.h" void secondserial_Command() { diff --git a/speeduino/comms.h b/speeduino/comms.h index 03b325b0..5076dc74 100644 --- a/speeduino/comms.h +++ b/speeduino/comms.h @@ -37,6 +37,8 @@ byte tsCanId = 0; // current tscanid requested byte inProgressOffset; byte inProgressLength; bool serialInProgress = false; +bool toothLogSendInProgress = false; +bool compositeLogSendInProgress = false; const char pageTitles[] PROGMEM //This is being stored in the avr flash instead of SRAM which there is not very much of { @@ -63,10 +65,10 @@ void saveConfig(); void sendPage(); void sendPageASCII(); void receiveCalibration(byte); -void sendToothLog(); +void sendToothLog(uint8_t); void testComm(); void commandButtons(int16_t); -void sendCompositeLog(); +void sendCompositeLog(uint8_t); byte getPageValue(byte, uint16_t); void updateFullStatus(); diff --git a/speeduino/comms.ino b/speeduino/comms.ino index 6b2df4d4..2e650208 100644 --- a/speeduino/comms.ino +++ b/speeduino/comms.ino @@ -8,7 +8,7 @@ A full copy of the license may be found in the projects root directory #include "cancomms.h" #include "storage.h" #include "maths.h" -#include "utils.h" +#include "utilities.h" #include "decoders.h" #include "TS_CommandButtonHandler.h" #include "errors.h" @@ -297,8 +297,8 @@ void command() Serial.read(); // First byte of the page identifier can be ignored. It's always 0 Serial.read(); // First byte of the page identifier can be ignored. It's always 0 - if(currentStatus.toothLogEnabled == true) { sendToothLog(); } //Sends tooth log values as ints - else if (currentStatus.compositeLogEnabled == true) { sendCompositeLog(); } + if(currentStatus.toothLogEnabled == true) { sendToothLog(0); } //Sends tooth log values as ints + else if (currentStatus.compositeLogEnabled == true) { sendCompositeLog(0); } cmdPending = false; } @@ -445,7 +445,7 @@ void command() break; case 'z': //Send 256 tooth log entries to a terminal emulator - sendToothLog(); //Sends tooth log values as chars + sendToothLog(0); //Sends tooth log values as chars break; case '`': //Custom 16u2 firmware is making its presence known @@ -1815,13 +1815,21 @@ Send 256 tooth log entries * if useChar is true, the values are sent as chars to be printed out by a terminal emulator * if useChar is false, the values are sent as a 2 byte integer which is readable by TunerStudios tooth logger */ -void sendToothLog() +void sendToothLog(byte startOffset) { //We need TOOTH_LOG_SIZE number of records to send to TunerStudio. If there aren't that many in the buffer then we just return and wait for the next call if (BIT_CHECK(currentStatus.status1, BIT_STATUS1_TOOTHLOG1READY)) //Sanity check. Flagging system means this should always be true { - for (int x = 0; x < TOOTH_LOG_SIZE; x++) + for (int x = startOffset; x < TOOTH_LOG_SIZE; x++) { + //Check whether the tx buffer still has space + if(Serial.availableForWrite() < 4) + { + //tx buffer is full. Store the current state so it can be resumed later + inProgressOffset = x; + toothLogSendInProgress = true; + return; + } //Serial.write(highByte(toothHistory[toothHistorySerialIndex])); //Serial.write(lowByte(toothHistory[toothHistorySerialIndex])); Serial.write(toothHistory[toothHistorySerialIndex] >> 24); @@ -1834,6 +1842,7 @@ void sendToothLog() } BIT_CLEAR(currentStatus.status1, BIT_STATUS1_TOOTHLOG1READY); cmdPending = false; + toothLogSendInProgress = false; } else { @@ -1846,13 +1855,22 @@ void sendToothLog() } } -void sendCompositeLog() +void sendCompositeLog(byte startOffset) { if (BIT_CHECK(currentStatus.status1, BIT_STATUS1_TOOTHLOG1READY)) //Sanity check. Flagging system means this should always be true { uint32_t runTime = 0; - for (int x = 0; x < TOOTH_LOG_SIZE; x++) + for (int x = startOffset; x < TOOTH_LOG_SIZE; x++) { + //Check whether the tx buffer still has space + if(Serial.availableForWrite() < 4) + { + //tx buffer is full. Store the current state so it can be resumed later + inProgressOffset = x; + compositeLogSendInProgress = true; + return; + } + runTime += toothHistory[toothHistorySerialIndex]; //This combined runtime (in us) that the log was going for by this record) //Serial.write(highByte(runTime)); @@ -1875,6 +1893,7 @@ void sendCompositeLog() toothHistorySerialIndex = 0; compositeLastToothTime = 0; cmdPending = false; + compositeLogSendInProgress = false; } else { diff --git a/speeduino/init.ino b/speeduino/init.ino index 0e0e375f..fc19a4d9 100644 --- a/speeduino/init.ino +++ b/speeduino/init.ino @@ -5,7 +5,7 @@ #include "speeduino.h" #include "timers.h" #include "cancomms.h" -#include "utils.h" +#include "utilities.h" #include "scheduledIO.h" #include "scheduler.h" #include "auxiliaries.h" diff --git a/speeduino/speeduino.ino b/speeduino/speeduino.ino index 3c545fbe..4a699beb 100644 --- a/speeduino/speeduino.ino +++ b/speeduino/speeduino.ino @@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "storage.h" #include "crankMaths.h" #include "init.h" -#include "utils.h" +#include "utilities.h" #include "engineProtection.h" #include BOARD_H //Note that this is not a real file, it is defined in globals.h. @@ -105,6 +105,16 @@ void loop() { if(Serial.availableForWrite() > 32) { sendValues(inProgressOffset, inProgressLength, 0x30, 0); } } + //Perform the same check for the tooth and composite logs + if( toothLogSendInProgress == true) + { + if(Serial.availableForWrite() > 32) { sendToothLog(inProgressOffset); } + } + if( compositeLogSendInProgress == true) + { + if(Serial.availableForWrite() > 32) { sendCompositeLog(inProgressOffset); } + } + //Check for any requets from serial. Serial operations are checked under 2 scenarios: // 1) Check every 15Hz for data // 2) If the amount of data in the serial buffer is greater than a set threhold (See globals.h). This is to avoid serial buffer overflow when large amounts of data is being sent diff --git a/speeduino/utils.h b/speeduino/utilities.h similarity index 100% rename from speeduino/utils.h rename to speeduino/utilities.h diff --git a/speeduino/utils.ino b/speeduino/utilities.ino similarity index 99% rename from speeduino/utils.ino rename to speeduino/utilities.ino index 81776dbd..64b70963 100644 --- a/speeduino/utils.ino +++ b/speeduino/utilities.ino @@ -6,7 +6,7 @@ #include #include "globals.h" -#include "utils.h" +#include "utilities.h" #include "decoders.h" #include "comms.h" #include "src/FastCRC/FastCRC.h" From 21063a60ff1bfcd45a47826d9a86be44b9aec455 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Sat, 22 Aug 2020 21:15:25 +1000 Subject: [PATCH 11/14] August 20 signatures and base tunes --- reference/Base Tunes/NA6 PNP base tune.msq | 1678 +++++++++++------- reference/Base Tunes/Speeduino base tune.msq | 1675 ++++++++++------- reference/speeduino.ini | 4 +- speeduino/comms.ino | 4 +- 4 files changed, 2005 insertions(+), 1356 deletions(-) diff --git a/reference/Base Tunes/NA6 PNP base tune.msq b/reference/Base Tunes/NA6 PNP base tune.msq index ce7337fe..43ae0780 100644 --- a/reference/Base Tunes/NA6 PNP base tune.msq +++ b/reference/Base Tunes/NA6 PNP base tune.msq @@ -1,16 +1,16 @@ - - - - "CAN ID 0" - 8000.0 - 3000.0 - 5000.0 - 255.0 - 200.0 - 245.0 - + + + +"CAN ID 0" +8000.0 +3000.0 +5000.0 +255.0 +200.0 +245.0 + -2.0 -1.5 -1.2 @@ -22,7 +22,7 @@ -0.1 0.0 - + 4.0 4.0 4.0 @@ -152,7 +152,7 @@ 4.0 4.0 - + 4.0 4.0 4.0 @@ -282,7 +282,7 @@ 4.0 4.0 - + 511.0 100.0 511.0 @@ -292,36 +292,38 @@ 100.0 100.0 - 255.0 - 255.0 - Aux0 - "GPS Speed" - 0.0 - "cc/min" - "Log HP & Tq" - "Off" - "US Gallons" - "Miles Per Hour" - 3450.0 - "lbs" - 0.34 - 32.0 - 19.3 - "sqft" - 25.5 - 1.0 - 3.7 - 0.0 - - - 4.0 - 100.0 - 0.0 - "TPS" - "Open Time only" - "Fixed" - "15" - +255.0 +255.0 +Aux0 +"GPS Speed" +0.0 +"cc/min" +"Log HP & Tq" +"Off" +"US Gallons" +"Miles Per Hour" +3450.0 +"lbs" +0.34 +32.0 +19.3 +"sqft" +25.5 +1.0 +3.7 +0.0 + + +25.5 +100.0 +0.0 +"TPS" +"Open Time only" +"Fixed" +"TPS" +"PW Adder" +"Baro" + 179.0 179.0 179.0 @@ -333,140 +335,140 @@ 108.0 100.0 - 10.0 - "NA6 MX5 PNP" - "Board Default" - "Normal" - 3.0 - 50.0 - 70.0 - 200.0 - "Unused" - "VE" - "CPU" - "TPS" - "Mem" - "RPM" - "RPM" - "RPM" - 12.7 - 2.0 - "Alternating" - "Yes" - "No" - "Full" - "MAP" - "Disabled" - 1.0 - +10.0 +"NA6 MX5 PNP" +"Board Default" +"Normal" +3.0 +50.0 +70.0 +200.0 +"Unused" +"VE" +"CPU" +"TPS" +"Mem" +"RPM" +"RPM" +"RPM" +12.7 +2.0 +"Alternating" +"No" +"No" +"Full" +"MAP" +"Disabled" +1.0 + 355.0 355.0 355.0 355.0 - "Cycle Average" - "Four-stroke" - "Port" - "4" - "MAP" - "Off" - "4" - "Even fire" - "Off" - "No" - "Off" - "Paired" - "Yes" - "Off" - 60.0 - 90.0 - 50.0 - 150.0 - 0.0 - 46.0 - 233.0 - 10.0 - 260.0 - 5.0 - 14.7 - 0.0 - 0.0 - 0.0 - "36" - "Normal" - "Off" - 20.0 - 1000.0 - 5000.0 - 40.0 - 80.0 - 12.0 - 16.0 - 14608.0 - -1.0 - 65535.0 - "Yes" - "No" - "30" - +"Cycle Average" +"Four-stroke" +"Port" +"4" +"MAP" +"Off" +"4" +"Even fire" +"Off" +"No" +"Off" +"Paired" +"Yes" +"Off" +60.0 +90.0 +50.0 +150.0 +0.0 +46.0 +233.0 +10.0 +260.0 +5.0 +14.7 +0.0 +0.0 +0.0 +"36" +"Normal" +"Off" +20.0 +1000.0 +5000.0 +40.0 +80.0 +12.0 +16.0 +14608.0 +-1.0 +65535.0 +"Yes" +"No" +"30" +"No" + 15.0 15.0 15.0 15.0 - + 15.0 15.0 5.0 3.0 - + -20.0 10.0 40.0 80.0 - + 1.0 1.0 1.0 1.0 - + -20.0 10.0 40.0 80.0 - "Board Default" - "Inverted" - "On" - "Off" - "TPS" - "4" - 2000.0 - 4.0 - +"Board Default" +"Inverted" +"On" +"Off" +"TPS" +"4" +2000.0 +4.0 + 500.0 2000.0 4500.0 6500.0 - 5.0 - 1.0 - 50.0 - "Off" - "Board Default" - 4000.0 - 50.0 - 4.5 - 7.5 - 12.5 - 15.8 - 18.6 - 21.0 - - 255.0 +5.0 +1.0 +50.0 +"Off" +"Board Default" +4000.0 +50.0 +4.5 +7.5 +12.5 +15.8 +18.6 +21.0 + 255.0 255.0 255.0 @@ -477,9 +479,10 @@ 255.0 255.0 - - - +25.5 + + + 36.0 36.0 40.0 40.0 19.0 16.0 14.0 26.0 42.0 42.0 42.0 41.0 41.0 41.0 41.0 41.0 36.0 37.0 40.0 31.0 16.0 17.0 14.0 24.0 51.0 50.0 49.0 48.0 47.0 46.0 46.0 46.0 37.0 37.0 45.0 36.0 22.0 25.0 21.0 37.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 @@ -497,7 +500,7 @@ 53.0 61.0 69.0 83.0 99.0 102.0 107.0 128.0 141.0 137.0 133.0 128.0 124.0 120.0 118.0 118.0 54.0 59.0 77.0 98.0 107.0 109.0 116.0 134.0 155.0 140.0 135.0 130.0 121.0 120.0 120.0 120.0 - + 500.0 700.0 900.0 @@ -515,7 +518,7 @@ 6600.0 6600.0 - + 16.0 26.0 30.0 @@ -533,9 +536,9 @@ 96.0 100.0 - - - + + + 17.0 20.0 20.0 24.0 25.0 28.0 31.0 33.0 34.0 35.0 36.0 37.0 38.0 38.0 39.0 40.0 17.0 20.0 20.0 24.0 25.0 28.0 31.0 33.0 34.0 35.0 36.0 37.0 38.0 38.0 39.0 40.0 17.0 20.0 20.0 24.0 25.0 28.0 31.0 33.0 34.0 35.0 36.0 37.0 38.0 38.0 39.0 40.0 @@ -553,7 +556,7 @@ 17.0 22.0 22.0 23.0 24.0 25.0 28.0 29.0 29.0 29.0 29.0 29.0 29.0 29.0 29.0 29.0 18.0 22.0 22.0 23.0 24.0 25.0 27.0 28.0 28.0 28.0 28.0 28.0 28.0 28.0 28.0 28.0 - + 500.0 1000.0 1500.0 @@ -571,7 +574,7 @@ 8000.0 9000.0 - + 10.0 16.0 20.0 @@ -589,53 +592,53 @@ 96.0 100.0 - - - 0.0 - 0.0 - 5.0 - 10.0 - "FALLING" - "Crank Speed" - "Going Low" - "4G63 / Miata / 3000GT" - "FALLING" - "Board Default" - "Yes" - 1.0 - "Single tooth cam" - 0.0 - "Disabled" - "9" - 0.0 - "Open Loop" - "On" - "Wasted Spark" - "Weak" - "On" - 6.0 - 4.0 - 2.0 - 1.0 - 400.0 - 90.0 - 6000.0 - 1.0 - 2.0 - 6000.0 - + + +0.0 +0.0 +5.0 +10.0 +"FALLING" +"Crank Speed" +"Going Low" +"4G63 / Miata / 3000GT" +"FALLING" +"Board Default" +"Yes" +1.0 +"Single tooth cam" +0.0 +"Disabled" +"9" +0.0 +"Open Loop" +"On" +"Wasted Spark" +"Weak" +"On" +6.0 +4.0 +2.0 +1.0 +400.0 +90.0 +6000.0 +1.0 +2.0 +6000.0 + 10.0 260.0 670.0 1000.0 - + 97.0 102.0 104.0 113.0 - + -40.0 -32.0 -23.0 @@ -647,8 +650,8 @@ 66.0 77.0 - 12.0 - +12.0 + 106.0 105.0 100.0 @@ -656,7 +659,7 @@ 91.0 85.0 - + 0.0 20.0 30.0 @@ -664,7 +667,7 @@ 60.0 100.0 - + 0.0 0.0 0.0 @@ -672,20 +675,20 @@ 0.0 0.0 - 1500.0 - 150.0 - 1.0 - "Off" - "3" - "HIGH" - 50.0 - 180.0 - 180.0 - 128.0 - 128.0 - 20.0 - 64.0 - +1500.0 +150.0 +1.0 +"Off" +"3" +"HIGH" +50.0 +180.0 +180.0 +128.0 +128.0 +20.0 +64.0 + -20.0 10.0 30.0 @@ -693,7 +696,7 @@ 60.0 80.0 - + 0.0 0.0 0.0 @@ -701,20 +704,20 @@ 0.0 0.0 - + 50.0 100.0 290.0 610.0 - + 50.0 95.0 148.0 192.0 - 0.0 - +0.0 + 87.0 93.0 97.0 @@ -724,7 +727,7 @@ 103.0 107.0 - + 100.0 100.0 100.0 @@ -734,7 +737,7 @@ 100.0 100.0 - + -200.0 -100.0 -50.0 @@ -742,7 +745,7 @@ 100.0 200.0 - + 0.0 0.0 0.0 @@ -750,8 +753,8 @@ 0.0 0.0 - - 255.0 +2500.0 + 255.0 255.0 255.0 @@ -760,9 +763,9 @@ 255.0 255.0 - - - + + + 14.7 14.7 14.7 14.8 15.1 15.1 15.0 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.8 15.1 15.1 15.0 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.8 15.1 15.1 15.0 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 @@ -780,7 +783,7 @@ 13.1 13.1 13.1 12.8 12.8 12.7 12.6 12.6 12.6 12.6 12.6 12.6 12.6 12.6 12.6 12.6 12.8 12.8 12.8 12.8 12.8 12.7 12.5 12.5 12.5 12.5 12.5 12.5 12.5 12.5 12.5 12.5 - + 500.0 700.0 900.0 @@ -798,7 +801,7 @@ 6500.0 6500.0 - + 16.0 26.0 30.0 @@ -816,37 +819,37 @@ 96.0 100.0 - - - "No correction" - "Wide Band" - "Off" - "Off" - "Off" - 100.0 - 20.0 - 0.0 - 158.0 - 16.0 - "On/Off" - "MAP" - "Advance" - "No" - "No" - "MAP" - 15.0 - 9.0 - 19.0 - 15.0 - 1200.0 - 70.0 - "26" - "No" - "Simple" - "20" - "No" - "No" - + + +"No correction" +"Wide Band" +"Off" +"Off" +"Spark Only" +100.0 +20.0 +0.0 +158.0 +16.0 +"On/Off" +"MAP" +"Advance" +"No" +"No" +"Off" +15.0 +9.0 +19.0 +15.0 +1200.0 +70.0 +"Board Default" +"No" +"Simple" +"20" +"No" +"No" + 7.0 9.0 12.1 @@ -854,7 +857,7 @@ 16.9 20.3 - + 154.0 117.0 101.0 @@ -862,7 +865,7 @@ 100.0 100.0 - + -40.0 -20.0 0.0 @@ -873,7 +876,7 @@ 91.0 120.0 - + 126.0 116.0 107.0 @@ -884,31 +887,31 @@ 81.0 74.0 - 30.0 - 300.0 - 160.0 - "Board Default" - "Yes" - "LOW" - 2500.0 - -15.0 - 4000.0 - 15.0 - 2.0 - 0.0 - 0.0 - 200.0 - 35.0 - 38.0 - 1.0 - "Pullup" - "No" - "No" - "A0" - 4500.0 - 30.0 - 2500.0 - +30.0 +300.0 +160.0 +"Board Default" +"Yes" +"LOW" +2500.0 +-15.0 +4000.0 +15.0 +2.0 +0.0 +0.0 +200.0 +35.0 +38.0 +1.0 +"Pullup" +"No" +"No" +"A0" +4500.0 +30.0 +2500.0 + 1200.0 1100.0 1050.0 @@ -920,7 +923,7 @@ 800.0 800.0 - + 0.0 0.0 0.0 @@ -932,7 +935,7 @@ 0.0 0.0 - + 0.0 0.0 0.0 @@ -944,7 +947,7 @@ 39.0 39.0 - + -40.0 -10.0 15.0 @@ -956,46 +959,46 @@ 87.0 103.0 - + 0.0 0.0 0.0 0.0 - + 40.0 0.0 0.0 0.0 - + -40.0 0.0 20.0 40.0 - "PWM Open loop" - "1" - "1" - "Normal" - -40.0 - 0.0 - 0.0 - "No" - "On/Off" - "Board Default" - 80.0 - 3.0 - 0.0 - +"PWM Open loop" +"1" +"1" +"Normal" +-40.0 +0.0 +256.0 +"No" +"On/Off" +"Board Default" +80.0 +3.0 +0.0 + -40.0 -40.0 -40.0 -40.0 - - - + + + 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 @@ -1005,7 +1008,7 @@ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - + 0.0 0.0 0.0 @@ -1015,7 +1018,7 @@ 0.0 0.0 - + 0.0 0.0 0.0 @@ -1025,7 +1028,7 @@ 0.0 0.0 - + 150.0 0.0 0.0 0.0 184.0 184.0 0.0 5.0 32.0 0.0 6.0 184.0 0.0 0.0 0.0 184.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 @@ -1035,7 +1038,7 @@ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 116.0 0.0 100.0 0.0 70.0 0.0 50.0 0.0 - + 0.0 0.0 0.0 @@ -1045,7 +1048,7 @@ 0.0 0.0 - + 255.0 255.0 255.0 @@ -1055,7 +1058,7 @@ 255.0 255.0 - + 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 10.0 18.0 25.0 @@ -1065,7 +1068,7 @@ 0.0 0.0 0.0 31.0 31.0 52.0 80.0 100.0 0.0 0.0 0.0 40.0 40.0 64.0 90.0 100.0 - + 100.0 600.0 1000.0 @@ -1075,7 +1078,7 @@ 5500.0 7000.0 - + 510.0 510.0 510.0 @@ -1085,9 +1088,9 @@ 510.0 510.0 - - - + + + -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 @@ -1095,7 +1098,7 @@ -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 - + 0.0 0.0 0.0 @@ -1103,7 +1106,7 @@ 0.0 0.0 - + 0.0 0.0 0.0 @@ -1111,7 +1114,7 @@ 0.0 0.0 - + -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 @@ -1119,7 +1122,7 @@ -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 - + 0.0 0.0 0.0 @@ -1127,7 +1130,7 @@ 0.0 0.0 - + 0.0 0.0 0.0 @@ -1135,7 +1138,7 @@ 0.0 0.0 - + -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 @@ -1143,7 +1146,7 @@ -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 - + 0.0 0.0 0.0 @@ -1151,7 +1154,7 @@ 0.0 0.0 - + 0.0 0.0 0.0 @@ -1159,7 +1162,7 @@ 0.0 0.0 - + -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 @@ -1167,7 +1170,7 @@ -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 -128.0 - + 0.0 0.0 0.0 @@ -1175,7 +1178,7 @@ 0.0 0.0 - + 0.0 0.0 0.0 @@ -1183,151 +1186,151 @@ 0.0 0.0 - - - "Disable" - "Disable" - "Enable" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "7" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - 255.0 - 255.0 - "On" - "On" - "Off" - "Off" - "Off" - "Off" - "Off" - "Off" - "Off" - + + +"Disable" +"Disable" +"Enable" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"7" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +255.0 +255.0 +"On" +"On" +"Off" +"Off" +"Off" +"Off" +"Off" +"Off" +"Off" + 0.0 0.0 0.0 @@ -1337,68 +1340,68 @@ 0.0 0.0 - "7" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - 0.0 - 0.0 - 0.0 - 0.0 - "CAN ID 0" - "0x100" - "0x100" - "0x100" - "A0" - "A0" - "A0" - "A0" - "A0" - "A0" - "A4" - "A0" - "A1" - "A6" - "A10" - "A10" - "A3" - "A3" - "A3" - "A8" - "30" - "8" - "1" - "8" - "11" - "8" - "12" - "8" - "1" - "8" - "26" - "8" - "46" - "8" - "7" - "8" - "Yes" - "0" - "" - "" - 765.0 - +"7" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +0.0 +0.0 +0.0 +0.0 +"CAN ID 0" +"0x100" +"0x100" +"0x100" +"A0" +"A0" +"A0" +"A0" +"A0" +"A0" +"A4" +"A0" +"A1" +"A6" +"A10" +"A10" +"A3" +"A3" +"A3" +"A8" +"30" +"8" +"1" +"8" +"11" +"8" +"12" +"8" +"1" +"8" +"26" +"8" +"46" +"8" +"7" +"8" +"Yes" +"0" +"" +"" +765.0 + 7.0 7.0 7.0 @@ -1437,25 +1440,25 @@ 7.0 7.0 - - - + + + -39.0 2.0 34.0 83.0 - + 175.0 155.0 130.0 125.0 - "FC" - "Off" - "Automatic" - "A0" - +"FC" +"Off" +"Automatic" +"A0" + 255.0 255.0 255.0 @@ -1465,7 +1468,7 @@ 255.0 255.0 - + 510.0 510.0 510.0 @@ -1475,12 +1478,12 @@ 510.0 510.0 - 65535.0 - 255.0 - 300.0 - 700.0 - 20.0 - +65535.0 +255.0 +300.0 +700.0 +20.0 + 0.0 20.0 40.0 @@ -1488,7 +1491,7 @@ 80.0 100.0 - + 50.0 50.0 50.0 @@ -1496,7 +1499,7 @@ 50.0 50.0 - + 0.0 20.0 40.0 @@ -1504,7 +1507,7 @@ 80.0 100.0 - + 100.0 105.0 115.0 @@ -1512,7 +1515,7 @@ 133.0 133.0 - + 0.0 20.0 40.0 @@ -1520,7 +1523,7 @@ 80.0 100.0 - + 10.0 14.0 15.0 @@ -1528,38 +1531,38 @@ 15.0 15.0 - "2 stage" - "30" - 60.0 - 250.0 - 50.0 - 17.0 - "31" - "LOW" - "Yes" - 3000.0 - 6000.0 - 6.0 - 3.0 - 5.0 - "32" - "No" - 6000.0 - 7000.0 - 3.0 - 2.0 - 5.0 - "Analog" - "3" - "LOW" - "Off" - "No" - "3" - "3" - 7.5 - 100.0 - 1000.0 - +"2 stage" +"30" +60.0 +250.0 +50.0 +17.0 +"31" +"LOW" +"Yes" +3000.0 +6000.0 +6.0 +3.0 +5.0 +"32" +"No" +6000.0 +7000.0 +3.0 +2.0 +5.0 +"Analog" +"3" +"LOW" +"Off" +"No" +"3" +"3" +7.5 +100.0 +1000.0 + 2000.0 3000.0 4000.0 @@ -1567,7 +1570,7 @@ 5000.0 5000.0 - + 0.0 0.0 0.0 @@ -1575,7 +1578,7 @@ -20.0 -20.0 - + 30.0 30.0 30.0 @@ -1583,78 +1586,73 @@ 15.0 3.0 - 1.0 - 2.0 - 20.0 - 0.2 - 0.1 - 0.0 - 0.0 - "MAP" - "Off" - "MAP" - 120.0 - "25" - "LOW" - "Yes" - 41.0 - 0.0 - 0.0 - 0.99968 - 240.0 - 561.0 - 0.5 - - 900.0 - 0.0 - 900.0 - 4700.0 - 11600.0 - 3300.0 +1.0 +2.0 +20.0 +0.2 +0.1 +0.0 +0.0 +"MAP" +"Off" +"MAP" +120.0 +"25" +"LOW" +"Yes" +41.0 +0.0 +0.0 +0.99968 +240.0 +561.0 +0.5 +"Off" +"Off" +"Off" +"A14" +"A15" +-18.0 +168.0 +-18.0 +168.0 + 500.0 + 1500.0 + 3500.0 + 6000.0 + + 0.0 + 30.0 + 40.0 + 40.0 + +"Off" +"Simple" +"Off" +0.0 +0.0 +0.0 +0.0 +-40.0 +0.0 +"Off" +"Board Default" +"Normal" +"Off" +"Board Default" +"Normal" +"Board Default" + 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 + 100.0 + 200.0 + 300.0 + 400.0 + 500.0 + + 0.0 0.0 0.0 @@ -1662,12 +1660,36 @@ 0.0 0.0 - +0.0 +0.0 +"Board Default" + + -40.0 + 0.0 + 30.0 + 60.0 + 90.0 + 120.0 + + + 100.0 + 100.0 + 100.0 + 100.0 + 100.0 + 100.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 0.0 - - - + + + 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 @@ -1685,7 +1707,7 @@ 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 - + 500.0 700.0 900.0 @@ -1703,7 +1725,7 @@ 6600.0 6600.0 - + 16.0 26.0 30.0 @@ -1721,17 +1743,319 @@ 96.0 100.0 - - - - - - - - - - - - - + + + + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + + + 25500.0 + 25500.0 + 25500.0 + 25500.0 + 25500.0 + 25500.0 + 25500.0 + 25500.0 + + + 510.0 + 510.0 + 510.0 + 510.0 + 510.0 + 510.0 + 510.0 + 510.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + +"Active high" +"Active low" +"Active low" +"Active low" +"Active low" +"Active low" +"Active low" +"Active low" +255.0 + + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + +"Disabled" +"Disabled" +"Disabled" +"Disabled" +"Disabled" +"Disabled" +"Disabled" +"Disabled" + + 1.0 + 25.5 + 25.5 + 25.5 + 25.5 + 25.5 + 25.5 + 25.5 + + + 14.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + +"RPM" + + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + + + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 100.0 + + + 6500.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + + + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + +">" +"==" +"Disabled" +"==" +"==" +"Disabled" +"==" +"==" +"XOR" +"==" +"==" +"XOR" +"==" +"==" +"XOR" +"==" +"==" +"XOR" +"==" +"==" +"XOR" +"==" +"==" +"Disabled" + + 25708.0 + 25700.0 + 25957.0 + 25957.0 + 26213.0 + 26214.0 + 26214.0 + 26471.0 + + + 103.0 + 103.0 + 103.0 + 104.0 + 104.0 + 104.0 + 104.0 + 104.0 + 104.0 + 105.0 + 105.0 + 105.0 + 105.0 + 105.0 + 106.0 + 106.0 + 106.0 + 106.0 + 106.0 + 107.0 + 107.0 + 107.0 + + + + + + + + + + + + + + diff --git a/reference/Base Tunes/Speeduino base tune.msq b/reference/Base Tunes/Speeduino base tune.msq index 90115c8b..d64ad355 100644 --- a/reference/Base Tunes/Speeduino base tune.msq +++ b/reference/Base Tunes/Speeduino base tune.msq @@ -1,16 +1,16 @@ - - - - "CAN ID 0" - 8000.0 - 3000.0 - 5000.0 - 255.0 - 200.0 - 245.0 - + + + +"CAN ID 0" +8000.0 +3000.0 +5000.0 +255.0 +200.0 +245.0 + -2.0 -1.5 -1.2 @@ -22,7 +22,7 @@ -0.1 0.0 - + 180.0 175.0 168.0 @@ -34,7 +34,7 @@ 102.0 100.0 - + 4.0 4.0 4.0 @@ -164,7 +164,7 @@ 4.0 4.0 - + 4.0 4.0 4.0 @@ -294,7 +294,7 @@ 4.0 4.0 - + 511.0 100.0 511.0 @@ -304,36 +304,39 @@ 100.0 100.0 - 255.0 - 255.0 - Aux0 - "GPS Speed" - 0.0 - "cc/min" - "Log HP & Tq" - "Off" - "US Gallons" - "Miles Per Hour" - 3450.0 - "lbs" - 0.34 - 32.0 - 19.3 - "sqft" - 25.5 - 1.0 - 3.7 - 0.0 - - - 4.0 - 100.0 - 0.0 - "TPS" - "Open Time only" - "Fixed" - "MAP" - +"1" +255.0 +255.0 +Aux0 +"GPS Speed" +0.0 +"cc/min" +"Log HP & Tq" +"Off" +"US Gallons" +"Miles Per Hour" +3450.0 +"lbs" +0.34 +32.0 +19.3 +"sqft" +25.5 +1.0 +3.7 +0.0 + + +25.5 +100.0 +0.0 +"TPS" +"Open Time only" +"Fixed" +"MAP" +"PW Multiplier" +"Baro" + 180.0 175.0 168.0 @@ -345,140 +348,140 @@ 102.0 100.0 - 20.0 - "Speeduino v0.4" - "Board Default" - "Normal" - 3.0 - 70.0 - 70.0 - 200.0 - "Unused" - "VE" - "CPU" - "TPS" - "Mem" - "RPM" - "RPM" - "RPM" - 12.2 - 2.0 - "Alternating" - "Yes" - "No" - "Full" - "MAP" - "Enabled" - 1.0 - +20.0 +"Speeduino v0.4" +"Board Default" +"Normal" +3.0 +70.0 +70.0 +200.0 +"Unused" +"VE" +"CPU" +"TPS" +"Mem" +"RPM" +"RPM" +"RPM" +12.2 +2.0 +"Alternating" +"No" +"No" +"Full" +"MAP" +"Enabled" +1.0 + 355.0 355.0 355.0 355.0 - "Cycle Average" - "Four-stroke" - "Port" - "4" - "MAP" - "Off" - "4" - "Even fire" - "Off" - "No" - "Off" - "Paired" - "Yes" - "Off" - 60.0 - 90.0 - 50.0 - 150.0 - 80.0 - 26.0 - 230.0 - 10.0 - 260.0 - 6.0 - 14.7 - 0.0 - 0.0 - 0.0 - "44" - "Normal" - "On" - 15.0 - 1000.0 - 5000.0 - 0.0 - 0.0 - 20.0 - 1.0 - 315.0 - 10.0 - 260.0 - "No" - "No" - "30" - +"Cycle Average" +"Four-stroke" +"Port" +"4" +"MAP" +"Off" +"4" +"Even fire" +"Off" +"No" +"Off" +"Paired" +"Yes" +"Off" +60.0 +90.0 +50.0 +150.0 +80.0 +26.0 +230.0 +10.0 +260.0 +6.0 +14.7 +0.0 +0.0 +0.0 +"44" +"Normal" +"On" +15.0 +1000.0 +5000.0 +0.0 +0.0 +20.0 +1.0 +315.0 +10.0 +260.0 +"No" +"No" +"30" +"No" + 70.0 50.0 35.0 35.0 - + 15.0 8.0 8.0 3.0 - + 0.0 40.0 80.0 100.0 - + 1.0 1.0 1.0 1.0 - + 0.0 40.0 60.0 100.0 - "Board Default" - "Inverted" - "On" - "Off" - "TPS" - "3" - 2000.0 - 4.0 - +"Board Default" +"Inverted" +"On" +"Off" +"TPS" +"3" +2000.0 +4.0 + 500.0 2000.0 4500.0 6500.0 - 5.0 - 1.0 - 50.0 - "Off" - "Board Default" - 4000.0 - 50.0 - 4.5 - 7.5 - 12.5 - 15.8 - 18.6 - 21.0 - - 255.0 +5.0 +1.0 +50.0 +"Off" +"Board Default" +4000.0 +50.0 +4.5 +7.5 +12.5 +15.8 +18.6 +21.0 + 255.0 255.0 255.0 @@ -489,9 +492,10 @@ 255.0 255.0 - - - +25.5 + + + 39.0 39.0 39.0 39.0 39.0 38.0 37.0 36.0 35.0 34.0 33.0 33.0 33.0 33.0 33.0 33.0 40.0 40.0 41.0 42.0 42.0 41.0 40.0 39.0 39.0 39.0 39.0 39.0 40.0 40.0 40.0 40.0 40.0 42.0 43.0 46.0 46.0 45.0 44.0 43.0 42.0 42.0 43.0 43.0 43.0 44.0 44.0 44.0 @@ -509,7 +513,7 @@ 93.0 93.0 93.0 93.0 93.0 93.0 93.0 90.0 90.0 90.0 90.0 91.0 92.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 95.0 - + 500.0 700.0 900.0 @@ -527,7 +531,7 @@ 6900.0 7000.0 - + 16.0 26.0 30.0 @@ -545,9 +549,9 @@ 96.0 100.0 - - - + + + 17.0 18.0 19.0 20.0 21.0 24.0 25.0 27.0 28.0 29.0 30.0 31.0 32.0 32.0 33.0 34.0 17.0 18.0 19.0 20.0 21.0 24.0 25.0 27.0 28.0 29.0 30.0 31.0 32.0 32.0 33.0 34.0 17.0 18.0 19.0 20.0 21.0 24.0 25.0 27.0 28.0 29.0 30.0 31.0 32.0 32.0 33.0 34.0 @@ -565,7 +569,7 @@ 16.0 16.0 16.0 14.0 11.0 11.0 11.0 11.0 11.0 11.0 11.0 9.0 9.0 9.0 9.0 9.0 15.0 15.0 15.0 13.0 10.0 10.0 10.0 10.0 10.0 10.0 10.0 8.0 8.0 8.0 8.0 8.0 - + 500.0 700.0 1200.0 @@ -583,7 +587,7 @@ 7200.0 7700.0 - + 10.0 16.0 20.0 @@ -601,53 +605,53 @@ 96.0 100.0 - - - 0.0 - 0.0 - 5.0 - 0.0 - "FALLING" - "Crank Speed" - "Going Low" - "Missing Tooth" - "FALLING" - "Board Default" - "No" - 1.0 - "Single tooth cam" - 0.0 - "Serial Command" - "Board Default" - 1.0 - "Open Loop" - "On" - "Wasted Spark" - "Off" - "Off" - 4.5 - 3.0 - 36.0 - 1.0 - 400.0 - 80.0 - 6500.0 - 20.0 - 2.0 - 7000.0 - + + +0.0 +0.0 +5.0 +0.0 +"FALLING" +"Crank Speed" +"Going Low" +"Missing Tooth" +"FALLING" +"Board Default" +"No" +1.0 +"Single tooth cam" +0.0 +"Serial Command" +"Board Default" +1.0 +"Open Loop" +"On" +"Wasted Spark" +"Off" +"Off" +4.5 +3.0 +36.0 +1.0 +400.0 +80.0 +6500.0 +20.0 +2.0 +7000.0 + 70.0 220.0 430.0 790.0 - + 15.0 59.0 74.0 85.0 - + -40.0 -26.0 -8.0 @@ -659,8 +663,8 @@ 69.0 80.0 - 8.0 - +8.0 + 110.0 105.0 100.0 @@ -668,7 +672,7 @@ 91.0 85.0 - + 58.0 82.0 93.0 @@ -676,7 +680,7 @@ 116.0 140.0 - + 0.0 0.0 2.0 @@ -684,20 +688,20 @@ 6.0 10.0 - 1500.0 - 200.0 - 1.0 - "Off" - "3" - "LOW" - 50.0 - 180.0 - 180.0 - 128.0 - 128.0 - 20.0 - 64.0 - +1500.0 +200.0 +1.0 +"Off" +"3" +"LOW" +50.0 +180.0 +180.0 +128.0 +128.0 +20.0 +64.0 + 0.0 20.0 40.0 @@ -705,7 +709,7 @@ 80.0 100.0 - + 0.0 0.0 0.0 @@ -713,20 +717,20 @@ 0.0 0.0 - + 80.0 220.0 500.0 860.0 - + 50.0 73.0 92.0 94.0 - 0.0 - +0.0 + 87.0 93.0 97.0 @@ -736,7 +740,7 @@ 103.0 107.0 - + 100.0 100.0 100.0 @@ -746,7 +750,7 @@ 100.0 100.0 - + -200.0 -100.0 -50.0 @@ -754,7 +758,7 @@ 100.0 200.0 - + 0.0 0.0 0.0 @@ -762,19 +766,19 @@ 0.0 0.0 - +2500.0 + 147.0 147.0 147.0 - 148.0 - 150.0 + 149.0 149.0 147.0 147.0 - - - + + + 14.7 14.7 14.7 14.7 15.0 15.1 15.1 14.8 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 15.0 15.1 15.1 14.8 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 15.0 15.1 15.1 14.8 14.7 14.7 14.7 14.7 14.7 14.7 14.7 14.7 @@ -792,7 +796,7 @@ 13.1 13.1 13.1 12.8 12.8 12.8 12.7 12.6 12.6 12.6 12.6 12.6 12.6 12.6 12.6 12.6 12.8 12.8 12.8 12.8 12.8 12.7 12.6 12.5 12.5 12.5 12.5 12.5 12.5 12.5 12.5 12.5 - + 500.0 700.0 900.0 @@ -810,7 +814,7 @@ 6900.0 7000.0 - + 16.0 26.0 30.0 @@ -828,37 +832,37 @@ 96.0 100.0 - - - "No correction" - "Wide Band" - "Off" - "Off" - "Spark Only" - 35.0 - 0.0 - 20.0 - 70.0 - 16.0 - "On/Off" - "MAP" - "Advance" - "No" - "No" - "MAP" - 15.0 - 9.0 - 19.0 - 15.0 - 1200.0 - 70.0 - "Board Default" - "No" - "Simple" - "Board Default" - "No" - "No" - + + +"No correction" +"Wide Band" +"Off" +"Off" +"Spark Only" +35.0 +0.0 +20.0 +70.0 +16.0 +"On/Off" +"MAP" +"Advance" +"No" +"No" +"Off" +15.0 +9.0 +19.0 +15.0 +1200.0 +70.0 +"Board Default" +"No" +"Simple" +"Board Default" +"No" +"No" + 6.6 9.4 12.1 @@ -866,7 +870,7 @@ 16.9 20.3 - + 110.0 106.0 100.0 @@ -874,7 +878,7 @@ 100.0 98.0 - + -40.0 -20.0 0.0 @@ -885,7 +889,7 @@ 90.0 120.0 - + 126.0 116.0 107.0 @@ -896,31 +900,31 @@ 81.0 74.0 - 30.0 - 300.0 - 120.0 - "Board Default" - "No" - "LOW" - 3500.0 - 15.0 - 4000.0 - 50.0 - 2.0 - 0.0 - 0.99968 - 200.0 - 50.0 - 0.0 - 10.0 - "Pullup" - "No" - "No" - "A0" - 400.0 - 5.0 - 2000.0 - +30.0 +300.0 +120.0 +"Board Default" +"No" +"LOW" +3500.0 +15.0 +4000.0 +50.0 +2.0 +0.0 +0.99968 +200.0 +50.0 +0.0 +10.0 +"Pullup" +"No" +"No" +"A0" +400.0 +5.0 +2000.0 + 1200.0 1150.0 1100.0 @@ -932,7 +936,7 @@ 800.0 800.0 - + 369.0 327.0 291.0 @@ -944,7 +948,7 @@ 45.0 0.0 - + 43.0 39.0 33.0 @@ -956,7 +960,7 @@ 16.0 9.0 - + -38.0 -19.0 1.0 @@ -968,46 +972,46 @@ 98.0 143.0 - + 123.0 579.0 390.0 300.0 - + 27.0 31.0 44.0 60.0 - + -28.0 6.0 44.0 76.0 - "None" - "3" - "1" - "Normal" - 50.0 - 240.0 - 4.0 - "No" - "Off" - "Board Default" - 75.0 - 2.0 - 6.0 - +"None" +"3" +"1" +"Normal" +50.0 +240.0 +4.0 +"No" +"Off" +"Board Default" +75.0 +2.0 +6.0 + 60.0 -20.0 -40.0 158.0 - - - + + + 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 150.0 @@ -1017,7 +1021,7 @@ 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 - + 1000.0 2000.0 3000.0 @@ -1027,7 +1031,7 @@ 6000.0 6800.0 - + 0.0 10.0 20.0 @@ -1037,7 +1041,7 @@ 80.0 100.0 - + 175.0 0.0 0.0 27.0 4.0 4.0 0.0 0.0 99.0 8.0 6.0 0.0 6.0 6.0 0.0 1.0 24.0 22.0 20.0 18.0 18.0 18.0 19.0 20.0 @@ -1047,7 +1051,7 @@ 56.0 56.0 56.0 55.0 55.0 55.0 55.0 56.0 68.0 68.0 69.0 69.0 69.0 69.0 69.0 69.0 - + 1000.0 2000.0 3000.0 @@ -1057,7 +1061,7 @@ 6000.0 6800.0 - + 255.0 255.0 255.0 @@ -1067,7 +1071,7 @@ 255.0 255.0 - + 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 @@ -1077,7 +1081,7 @@ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - + 500.0 1000.0 2000.0 @@ -1087,7 +1091,7 @@ 6000.0 7000.0 - + 100.0 100.0 100.0 @@ -1097,9 +1101,9 @@ 100.0 100.0 - - - + + + 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 @@ -1107,7 +1111,7 @@ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - + 700.0 1500.0 3000.0 @@ -1115,7 +1119,7 @@ 5500.0 7000.0 - + 36.0 50.0 66.0 @@ -1123,7 +1127,7 @@ 100.0 120.0 - + 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 @@ -1131,7 +1135,7 @@ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - + 700.0 1500.0 3000.0 @@ -1139,7 +1143,7 @@ 5500.0 7000.0 - + 36.0 50.0 66.0 @@ -1147,7 +1151,7 @@ 100.0 120.0 - + 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 @@ -1155,7 +1159,7 @@ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - + 700.0 1500.0 3000.0 @@ -1163,7 +1167,7 @@ 5500.0 7000.0 - + 36.0 50.0 66.0 @@ -1171,7 +1175,7 @@ 100.0 120.0 - + 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 @@ -1179,7 +1183,7 @@ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - + 700.0 1500.0 3000.0 @@ -1187,7 +1191,7 @@ 5500.0 7000.0 - + 36.0 50.0 66.0 @@ -1195,151 +1199,151 @@ 100.0 120.0 - - - "Disable" - "Disable" - "Enable" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "Off" - "Digital_local" - "Via Secondary Serial" - "Via Internal CAN" - "Via Internal CAN" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x706" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x100" - "0x6FD" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "7" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - "2" - 255.0 - 255.0 - "On" - "On" - "On" - "On" - "On" - "On" - "On" - "On" - "On" - + + +"Disable" +"Disable" +"Enable" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"Off" +"Digital_local" +"Via Secondary Serial" +"Via Internal CAN" +"Via Internal CAN" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x706" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x100" +"0x6FD" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"7" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +"2" +255.0 +255.0 +"On" +"On" +"On" +"On" +"On" +"On" +"On" +"On" +"On" + 65535.0 65535.0 65535.0 @@ -1349,68 +1353,68 @@ 65535.0 65535.0 - "7" - "0" - "0" - "0" - "0" - "0" - "0" - "0" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - "1" - 255.0 - 255.0 - 255.0 - 255.0 - "CAN ID 0" - "0x101" - "0x201" - "0x2FF" - "A0" - "A0" - "A0" - "A0" - "A0" - "A0" - "A4" - "A0" - "A1" - "A6" - "A10" - "A10" - "A10" - "A0" - "A5" - "A8" - "30" - "8" - "1" - "8" - "11" - "8" - "12" - "8" - "1" - "8" - "26" - "8" - "46" - "8" - "7" - "8" - "No" - "1" - "" - "" - 21.0 - +"7" +"0" +"0" +"0" +"0" +"0" +"0" +"0" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +"1" +255.0 +255.0 +255.0 +255.0 +"CAN ID 0" +"0x101" +"0x201" +"0x2FF" +"A0" +"A0" +"A0" +"A0" +"A0" +"A0" +"A4" +"A0" +"A1" +"A6" +"A10" +"A10" +"A10" +"A0" +"A5" +"A8" +"30" +"8" +"1" +"8" +"11" +"8" +"12" +"8" +"1" +"8" +"26" +"8" +"46" +"8" +"7" +"8" +"No" +"1" +"" +"" +21.0 + 7.0 7.0 7.0 @@ -1449,25 +1453,25 @@ 7.0 7.0 - - - + + + -40.0 0.0 30.0 70.0 - + 140.0 115.0 105.0 100.0 - "FC" - "Off" - "Automatic" - "A0" - +"FC" +"Off" +"Automatic" +"A0" + 0.0 0.0 0.0 @@ -1477,7 +1481,7 @@ 11.0 12.0 - + 0.0 30.0 50.0 @@ -1487,12 +1491,12 @@ 140.0 200.0 - 2047.0 - 20.0 - 200.0 - 600.0 - 255.0 - +2047.0 +20.0 +200.0 +600.0 +255.0 + 0.0 20.0 40.0 @@ -1500,7 +1504,7 @@ 80.0 100.0 - + 0.0 10.0 20.0 @@ -1508,7 +1512,7 @@ 40.0 50.0 - + 0.0 20.0 40.0 @@ -1516,7 +1520,7 @@ 80.0 100.0 - + 100.0 139.0 156.0 @@ -1524,7 +1528,7 @@ 163.0 163.0 - + 0.0 20.0 40.0 @@ -1532,7 +1536,7 @@ 80.0 100.0 - + 0.0 2.0 5.0 @@ -1540,38 +1544,38 @@ 9.0 10.0 - "Off" - "34" - 20.0 - 250.0 - 30.0 - 18.0 - "30" - "LOW" - "No" - 3000.0 - 6000.0 - 6.0 - 3.0 - 5.0 - "31" - "No" - 6000.0 - 7000.0 - 3.0 - 1.5 - 5.0 - "Analog" - "3" - "LOW" - "Off" - "No" - "3" - "3" - 7.5 - 100.0 - 1000.0 - +"Off" +"34" +20.0 +250.0 +30.0 +18.0 +"30" +"LOW" +"No" +3000.0 +6000.0 +6.0 +3.0 +5.0 +"31" +"No" +6000.0 +7000.0 +3.0 +1.5 +5.0 +"Analog" +"3" +"LOW" +"Off" +"No" +"3" +"3" +7.5 +100.0 +1000.0 + 2000.0 3000.0 4000.0 @@ -1579,7 +1583,7 @@ 6000.0 5000.0 - + 0.0 0.0 0.0 @@ -1587,7 +1591,7 @@ 0.0 -20.0 - + 30.0 30.0 30.0 @@ -1595,78 +1599,73 @@ 30.0 15.0 - 3.0 - 1.0 - 2.0 - 2.0 - 0.2 - 0.1 - 0.0 - "MAP" - "Off" - "MAP" - 120.0 - "25" - "LOW" - "Yes" - 41.0 - 0.0 - 0.0 - 0.99968 - 240.0 - 561.0 - 0.5 - - 900.0 - 0.0 - 900.0 - 4700.0 - 11600.0 - 3300.0 +3.0 +1.0 +2.0 +2.0 +0.2 +0.1 +0.0 +"MAP" +"Off" +"MAP" +120.0 +"25" +"LOW" +"Yes" +41.0 +0.0 +0.0 +0.99968 +240.0 +561.0 +0.5 +"Off" +"Off" +"Off" +"A14" +"A15" +-18.0 +168.0 +-18.0 +168.0 + 500.0 + 1500.0 + 3500.0 + 6000.0 + + 0.0 + 30.0 + 40.0 + 40.0 + +"Off" +"Simple" +"Off" +0.0 +0.0 +0.0 +0.0 +-40.0 +0.0 +"Off" +"Board Default" +"Normal" +"Off" +"Board Default" +"Normal" +"Board Default" + 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 + 100.0 + 200.0 + 300.0 + 400.0 + 500.0 + + 0.0 0.0 0.0 @@ -1674,12 +1673,36 @@ 0.0 0.0 - +0.0 +0.0 +"Board Default" + + -40.0 + 0.0 + 30.0 + 60.0 + 90.0 + 120.0 + + + 100.0 + 100.0 + 100.0 + 100.0 + 100.0 + 100.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 0.0 - - - + + + 39.0 39.0 39.0 39.0 39.0 38.0 37.0 36.0 35.0 34.0 33.0 33.0 33.0 33.0 33.0 33.0 40.0 40.0 41.0 42.0 42.0 41.0 40.0 39.0 39.0 39.0 39.0 39.0 40.0 40.0 40.0 40.0 40.0 42.0 43.0 46.0 46.0 45.0 44.0 43.0 42.0 42.0 43.0 43.0 43.0 44.0 44.0 44.0 @@ -1697,7 +1720,7 @@ 93.0 93.0 93.0 93.0 93.0 93.0 93.0 90.0 90.0 90.0 90.0 91.0 92.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 93.0 95.0 - + 500.0 700.0 900.0 @@ -1715,7 +1738,7 @@ 6900.0 7000.0 - + 16.0 26.0 30.0 @@ -1733,13 +1756,315 @@ 96.0 100.0 - - - - - - - - - + + + + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + 255.0 255.0 255.0 255.0 255.0 255.0 255.0 255.0 + + + 25500.0 + 25500.0 + 25500.0 + 25500.0 + 25500.0 + 25500.0 + 25500.0 + 25500.0 + + + 510.0 + 510.0 + 510.0 + 510.0 + 510.0 + 510.0 + 510.0 + 510.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + +"Active high" +"Active low" +"Active low" +"Active low" +"Active low" +"Active low" +"Active low" +"Active low" +255.0 + + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + +"Disabled" +"Disabled" +"Disabled" +"Disabled" +"Disabled" +"Disabled" +"Disabled" +"Disabled" + + 1.0 + 25.5 + 25.5 + 25.5 + 25.5 + 25.5 + 25.5 + 25.5 + + + 7.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + +"coolant" + + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + + + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 255.0 + 95.0 + + + 95.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + + + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + -1.0 + +">" +"==" +"Disabled" +"==" +"==" +"Disabled" +"==" +"==" +"XOR" +"==" +"==" +"XOR" +"==" +"==" +"XOR" +"==" +"==" +"XOR" +"==" +"==" +"XOR" +"==" +"==" +"Disabled" + + 25708.0 + 25700.0 + 25957.0 + 25957.0 + 26213.0 + 26214.0 + 26214.0 + 26471.0 + + + 103.0 + 103.0 + 103.0 + 104.0 + 104.0 + 104.0 + 104.0 + 104.0 + 104.0 + 105.0 + 105.0 + 105.0 + 105.0 + 105.0 + 106.0 + 106.0 + 106.0 + 106.0 + 106.0 + 107.0 + 107.0 + 107.0 + + + + + + + + + + diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 6901595e..f7b507c6 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -6,7 +6,7 @@ MTversion = 2.25 queryCommand = "Q" - signature = "speeduino 202006-dev" + signature = "speeduino 202008" versionInfo = "S" ;This info is what is displayed to user [TunerStudio] @@ -1527,7 +1527,7 @@ menuDialog = main subMenu = std_realtime, "Realtime Display" subMenu = accelEnrichments, "Acceleration Enrichment" subMenu = egoControl, "AFR/O2", 3 - subMenu = RevLimiterS, "Limiters", 2 + subMenu = RevLimiterS, "Engine Protection", 2 subMenu = flexFueling, "Flex Fuel", 2 subMenu = veTableDialog, "VE Table", 0 subMenu = sparkTbl, "Spark Table", 2 diff --git a/speeduino/comms.ino b/speeduino/comms.ino index 2e650208..aee9782a 100644 --- a/speeduino/comms.ino +++ b/speeduino/comms.ino @@ -248,7 +248,7 @@ void command() break; case 'Q': // send code version - Serial.print(F("speeduino 202006-dev")); + Serial.print(F("speeduino 202008")); break; case 'r': //New format for the optimised OutputChannels @@ -278,7 +278,7 @@ void command() break; case 'S': // send code version - Serial.print(F("Speeduino 2020.06-dev")); + Serial.print(F("Speeduino 2020.08")); currentStatus.secl = 0; //This is required in TS3 due to its stricter timings break; From e68ab5f2858782740c3887ddd083bb9508a6b36d Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Sat, 22 Aug 2020 21:47:46 +1000 Subject: [PATCH 12/14] Fix for composite log not tracking time correctly after last commit --- speeduino/comms.h | 1 + speeduino/comms.ino | 13 +++++++------ speeduino/updates.ino | 1 - 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/speeduino/comms.h b/speeduino/comms.h index 5076dc74..1da9ff1b 100644 --- a/speeduino/comms.h +++ b/speeduino/comms.h @@ -36,6 +36,7 @@ int valueOffset; /**< THe memory offset within a given page for a value to be re byte tsCanId = 0; // current tscanid requested byte inProgressOffset; byte inProgressLength; +uint32_t inProgressCompositeTime; bool serialInProgress = false; bool toothLogSendInProgress = false; bool compositeLogSendInProgress = false; diff --git a/speeduino/comms.ino b/speeduino/comms.ino index aee9782a..4b949112 100644 --- a/speeduino/comms.ino +++ b/speeduino/comms.ino @@ -1859,7 +1859,7 @@ void sendCompositeLog(byte startOffset) { if (BIT_CHECK(currentStatus.status1, BIT_STATUS1_TOOTHLOG1READY)) //Sanity check. Flagging system means this should always be true { - uint32_t runTime = 0; + if(startOffset == 0) { inProgressCompositeTime = 0; } for (int x = startOffset; x < TOOTH_LOG_SIZE; x++) { //Check whether the tx buffer still has space @@ -1871,14 +1871,14 @@ void sendCompositeLog(byte startOffset) return; } - runTime += toothHistory[toothHistorySerialIndex]; //This combined runtime (in us) that the log was going for by this record) + inProgressCompositeTime += toothHistory[toothHistorySerialIndex]; //This combined runtime (in us) that the log was going for by this record) //Serial.write(highByte(runTime)); //Serial.write(lowByte(runTime)); - Serial.write(runTime >> 24); - Serial.write(runTime >> 16); - Serial.write(runTime >> 8); - Serial.write(runTime); + Serial.write(inProgressCompositeTime >> 24); + Serial.write(inProgressCompositeTime >> 16); + Serial.write(inProgressCompositeTime >> 8); + Serial.write(inProgressCompositeTime); //Serial.write(highByte(toothHistory[toothHistorySerialIndex])); //Serial.write(lowByte(toothHistory[toothHistorySerialIndex])); @@ -1894,6 +1894,7 @@ void sendCompositeLog(byte startOffset) compositeLastToothTime = 0; cmdPending = false; compositeLogSendInProgress = false; + inProgressCompositeTime = 0; } else { diff --git a/speeduino/updates.ino b/speeduino/updates.ino index 71d0b429..4e4de609 100644 --- a/speeduino/updates.ino +++ b/speeduino/updates.ino @@ -425,7 +425,6 @@ void doUpdates() writeAllConfig(); EEPROM.write(EEPROM_DATA_VERSION, 15); - } //Final check is always for 255 and 0 (Brand new arduino) From 6b5788d09f69bbc9c6b358caed96e91530fc1d11 Mon Sep 17 00:00:00 2001 From: celso acyr <41055332+celturbo@users.noreply.github.com> Date: Sat, 22 Aug 2020 18:33:49 -0300 Subject: [PATCH 13/14] FIX A8 Fixed duplicate A8 (#443) Fixed duplicate A8 --- reference/speeduino.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/speeduino.ini b/reference/speeduino.ini index f7b507c6..8995b302 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -614,7 +614,7 @@ page = 6 fuelTrimEnabled= bits, U08, 60, [2:2], "No", "Yes" flatSEnable = bits, U08, 60, [3:3], "No", "Yes" ; Baro Sensor pin - baroPin = bits, U08, 60, [4:7], "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A8", "A10", "A11", "A12", "A13", "A14", "A15" + baroPin = bits, U08, 60, [4:7], "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15" ; Flat shift flatSSoftWin = scalar, U08, 61, "rpm", 100, 0.0, 100, 25500, 0 @@ -959,7 +959,7 @@ page = 10 rotaryType = bits , U08, 8, [0:1], "FC", "FD", "RX8", "INVALID" stagingEnabled = bits , U08, 8, [2:2], "Off","On" stagingMode = bits , U08, 8, [3:3], "Table","Automatic" - EMAPPin = bits, U08, 8, [4:7], "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A8", "A10", "A11", "A12", "A13", "A14", "A15" + EMAPPin = bits, U08, 8, [4:7], "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15" rotarySplitValues = array, U08, 9, [8], "degrees", 1.0, 0.0, 0.0, 40, 0 rotarySplitBins = array, U08, 17, [8], { bitStringValue(algorithmUnits , algorithm) }, 2.0, 0.0, 0.0, {fuelLoadMax}, 0 @@ -1058,8 +1058,8 @@ page = 10 oilPressureEnable = bits, U08, 135, [1:1], "Off", "On" oilPressureProtEnbl = bits, U08, 135, [2:2], "Off", "On" - fuelPressurePin = bits, U08, 136, [0:3], "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A8", "A10", "A11", "A12", "A13", "A14", "A15" - oilPressurePin = bits, U08, 136, [4:7], "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A8", "A10", "A11", "A12", "A13", "A14", "A15" + fuelPressurePin = bits, U08, 136, [0:3], "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15" + oilPressurePin = bits, U08, 136, [4:7], "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15" fuelPressureMin = scalar, S08, 137, "psi", 1.0, 0.0, -100, 127, 0 ;Note signed int fuelPressureMax = scalar, U08, 138, "psi", 1.0, 0.0, 0.0, 255, 0 From 9a0f770a759d65a5824d86f2f0313029e603b8af Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Sun, 23 Aug 2020 08:09:51 +1000 Subject: [PATCH 14/14] September 2020 development signatures --- reference/speeduino.ini | 2 +- speeduino/comms.ino | 9 ++------- speeduino/updates.ino | 9 ++++++++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 8995b302..4c89dad1 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -6,7 +6,7 @@ MTversion = 2.25 queryCommand = "Q" - signature = "speeduino 202008" + signature = "speeduino 202009-dev" versionInfo = "S" ;This info is what is displayed to user [TunerStudio] diff --git a/speeduino/comms.ino b/speeduino/comms.ino index 4b949112..efec3e50 100644 --- a/speeduino/comms.ino +++ b/speeduino/comms.ino @@ -248,7 +248,7 @@ void command() break; case 'Q': // send code version - Serial.print(F("speeduino 202008")); + Serial.print(F("speeduino 202009-dev")); break; case 'r': //New format for the optimised OutputChannels @@ -278,7 +278,7 @@ void command() break; case 'S': // send code version - Serial.print(F("Speeduino 2020.08")); + Serial.print(F("Speeduino 2020.09-dev")); currentStatus.secl = 0; //This is required in TS3 due to its stricter timings break; @@ -1873,16 +1873,11 @@ void sendCompositeLog(byte startOffset) inProgressCompositeTime += toothHistory[toothHistorySerialIndex]; //This combined runtime (in us) that the log was going for by this record) - //Serial.write(highByte(runTime)); - //Serial.write(lowByte(runTime)); Serial.write(inProgressCompositeTime >> 24); Serial.write(inProgressCompositeTime >> 16); Serial.write(inProgressCompositeTime >> 8); Serial.write(inProgressCompositeTime); - //Serial.write(highByte(toothHistory[toothHistorySerialIndex])); - //Serial.write(lowByte(toothHistory[toothHistorySerialIndex])); - Serial.write(compositeLogHistory[toothHistorySerialIndex]); //The status byte (Indicates the trigger edge, whether it was a pri/sec pulse, the sync status) if(toothHistorySerialIndex == (TOOTH_LOG_BUFFER-1)) { toothHistorySerialIndex = 0; } diff --git a/speeduino/updates.ino b/speeduino/updates.ino index 4e4de609..265858bb 100644 --- a/speeduino/updates.ino +++ b/speeduino/updates.ino @@ -10,7 +10,7 @@ void doUpdates() { - #define CURRENT_DATA_VERSION 15 + #define CURRENT_DATA_VERSION 16 //May 2017 firmware introduced a -40 offset on the ignition table. Update that table to +40 if(EEPROM.read(EEPROM_DATA_VERSION) == 2) @@ -426,6 +426,13 @@ void doUpdates() writeAllConfig(); EEPROM.write(EEPROM_DATA_VERSION, 15); } + + if(EEPROM.read(EEPROM_DATA_VERSION) == 15) + { + + writeAllConfig(); + //EEPROM.write(EEPROM_DATA_VERSION, 16); + } //Final check is always for 255 and 0 (Brand new arduino) if( (EEPROM.read(EEPROM_DATA_VERSION) == 0) || (EEPROM.read(EEPROM_DATA_VERSION) == 255) )