From 3807bb20e2d5c4290e197bc6931dc09a6de1ea40 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 6 Dec 2022 16:46:07 -0800 Subject: [PATCH] ini updates --- firmware/auxout.cpp | 28 +-- .../boards/f1_dual/wideband_board_config.h | 4 +- .../boards/f1_rev2/wideband_board_config.h | 2 +- .../boards/f1_rev3/wideband_board_config.h | 2 +- firmware/boards/port.h | 11 +- firmware/ini/rusefi_wb_f1.ini | 83 ++++----- firmware/ini/rusefi_wb_f1_dual.ini | 162 ++++++++++-------- firmware/livedata.cpp | 2 +- firmware/livedata.h | 3 +- 9 files changed, 166 insertions(+), 131 deletions(-) diff --git a/firmware/auxout.cpp b/firmware/auxout.cpp index dedcc26..9290b91 100644 --- a/firmware/auxout.cpp +++ b/firmware/auxout.cpp @@ -120,23 +120,29 @@ void SetAuxDac(int channel, float voltage) #if (defined(AUXOUT_DAC_PWM_DEVICE) || defined(AUXOUT_DAC_DEVICE)) -static float AuxGetInputSignal(int sel) +static float AuxGetInputSignal(AuxOutputMode sel) { switch (sel) { - case 0: - case 1: - return GetLambda(sel); + case AuxOutputMode::Afr0: + return 14.7f * GetLambda(0); + case AuxOutputMode::Afr1: + return 14.7f * GetLambda(1); + case AuxOutputMode::Lambda0: + return GetLambda(0); + case AuxOutputMode::Lambda1: + return GetLambda(1); #if HAL_USE_SPI - case 2: - case 3: - return getEgtDrivers()[sel - 2].temperature; + case AuxOutputMode::Egt0: + return getEgtDrivers()[0].temperature; + case AuxOutputMode::Egt1: + return getEgtDrivers()[1].temperature; #endif default: - return 0.0; - + return 0; } - return 0.0; + + return 0; } /* TODO: merge with some other communication thread? */ @@ -150,7 +156,7 @@ void AuxOutThread(void*) for (int ch = 0; ch < AFR_CHANNELS; ch++) { auto cfg = GetConfiguration(); - float input = AuxGetInputSignal(cfg->auxInput[ch]); + float input = AuxGetInputSignal(cfg->auxOutputSource[ch]); float voltage = interpolate2d(input, cfg->auxOutBins[ch], cfg->auxOutValues[ch]); SetAuxDac(ch, voltage); diff --git a/firmware/boards/f1_dual/wideband_board_config.h b/firmware/boards/f1_dual/wideband_board_config.h index 80e2e94..3a80d76 100644 --- a/firmware/boards/f1_dual/wideband_board_config.h +++ b/firmware/boards/f1_dual/wideband_board_config.h @@ -1,7 +1,7 @@ #pragma once // TS settings -#define TS_SIGNATURE "rusEFI 2022.12.02.wideband_dual" +#define TS_SIGNATURE "rusEFI 2022\.12\.06\.wideband_dual" // This board implements two channels #define AFR_CHANNELS 2 @@ -68,5 +68,5 @@ // Serial connection over BT module // enable BT module setup attempt -#define BT_SERIAL_OVER_JDY33 TRUE +#define BT_SERIAL_OVER_JDY33 FALSE #define BT_BROADCAST_NAME "RusEFI WBO x2" diff --git a/firmware/boards/f1_rev2/wideband_board_config.h b/firmware/boards/f1_rev2/wideband_board_config.h index 19db87f..3c845f8 100644 --- a/firmware/boards/f1_rev2/wideband_board_config.h +++ b/firmware/boards/f1_rev2/wideband_board_config.h @@ -1,7 +1,7 @@ #pragma once // TS settings -#define TS_SIGNATURE "rusEFI 2022.12.02.wideband_f1" +#define TS_SIGNATURE "rusEFI 2022\.12\.06\.wideband_f1" // Fundamental board constants #define VCC_VOLTS (3.3f) diff --git a/firmware/boards/f1_rev3/wideband_board_config.h b/firmware/boards/f1_rev3/wideband_board_config.h index 19db87f..3c845f8 100644 --- a/firmware/boards/f1_rev3/wideband_board_config.h +++ b/firmware/boards/f1_rev3/wideband_board_config.h @@ -1,7 +1,7 @@ #pragma once // TS settings -#define TS_SIGNATURE "rusEFI 2022.12.02.wideband_f1" +#define TS_SIGNATURE "rusEFI 2022\.12\.06\.wideband_f1" // Fundamental board constants #define VCC_VOLTS (3.3f) diff --git a/firmware/boards/port.h b/firmware/boards/port.h index 9f405f0..3c1fdf8 100644 --- a/firmware/boards/port.h +++ b/firmware/boards/port.h @@ -24,6 +24,15 @@ enum class SensorType : uint8_t { LSUADV = 2, }; +enum class AuxOutputMode : uint8_t { + Afr0 = 0, + Afr1 = 1, + Lambda0 = 2, + Lambda1 = 3, + Egt0 = 4, + Egt1 = 5, +}; + class Configuration { private: // Increment this any time the configuration format changes @@ -45,7 +54,7 @@ public: // AUX0 and AUX1 curves float auxOutBins[2][8]; float auxOutValues[2][8]; - uint8_t auxInput[2]; + AuxOutputMode auxOutputSource[2]; SensorType sensorType; } __attribute__((packed)); diff --git a/firmware/ini/rusefi_wb_f1.ini b/firmware/ini/rusefi_wb_f1.ini index b8a9a76..d206f20 100644 --- a/firmware/ini/rusefi_wb_f1.ini +++ b/firmware/ini/rusefi_wb_f1.ini @@ -12,12 +12,12 @@ enable2ndByteCanID = false [MegaTune] ; https://rusefi.com/forum/viewtopic.php?p=36201#p36201 - signature = "rusEFI 2022.12.02.wideband_rev2" + signature = "rusEFI 2022\.12\.06\.wideband_rev2" [TunerStudio] queryCommand = "S" versionInfo = "V" ; firmware version for title bar. - signature = "rusEFI 2022.12.02.wideband_f1" ; signature is expected to be 7 or more characters. + signature = "rusEFI 2022\.12\.06\.wideband_f1" ; signature is expected to be 7 or more characters. ; TS will try to use legacy temp units in some cases, showing "deg F" on a CLT gauge that's actually deg C useLegacyFTempUnits = false @@ -79,20 +79,18 @@ LsuSensorType = bits, U08, 135, [0:2], "LSU 4.9", "LSU 4.2", "LSU ADV" ochBlockSize = 256 ; Common -VBatt = scalar, F32, 0, "V", 1, 0, 0.0, 30.0, 2 +VBatt = scalar, F32, 0, "V", 1, 0 ; AFR0 -AFR0_in = scalar, F32, 32, "", 14.7, 0, 0.0, 20.0, 2 -AFR0_temp = scalar, F32, 36, "C", 1, 0, 0.0, 1050.0, 0 -AFR0_Nernst = scalar, F32, 40, "V", 1, 0, 0.0, 1.0, 2 -AFR0_PumpITarget = scalar, F32, 44, "mA", 1, 0, -5.0, 5.0, 2 -AFR0_PumpIMeasure = scalar, F32, 48, "mA", 1, 0, -5.0, 5.0, 2 -AFR0_HeaterDuty = scalar, F32, 52, "%", 100, 0, 0.0, 100.0, 0 -AFR0_fault = scalar, U08, 56, "", 1, 0, 0, 6, 0 -AFR0_heater = scalar, U08, 57, "", 1, 0, 0, 4, 0 - - -seconds = scalar, U32, 124, "sec", 1, 0 +AFR0_lambda = scalar, F32, 32, "", 1, 0 +AFR0_afr = scalar, F32, 32, "", 14.7, 0 +AFR0_temp = scalar, F32, 36, "C", 1, 0 +AFR0_Nernst = scalar, F32, 40, "V", 1, 0 +AFR0_PumpITarget = scalar, F32, 44, "mA", 1, 0 +AFR0_PumpIMeasure = scalar, F32, 48, "mA", 1, 0 +AFR0_HeaterDuty = scalar, F32, 52, "%", 100, 0 +AFR0_fault = scalar, U08, 56, "", 1, 0 +AFR0_heater = scalar, U08, 57, "", 1, 0 [PcVariables] ; Keep in sync with Max31855State enum from max31855.h @@ -108,19 +106,18 @@ seconds = scalar, U32, 124, "sec", 1, 0 gaugeCategory = Common ; Name = Channel, Title, Units, Lo, Hi, LoD, LoW, HiW, HiD, vd, ld, Active -VBattGauge = VBatt, "Battery", "V", 3.0, 24.0, 9.0, 11.0, 15.0, 16.0, 2, 2 +VBattGauge = VBatt, "Battery", "V", 3.0, 24.0, 9.0, 11.0, 15.0, 16.0, 1, 1 ; AFR0 gaugeCategory = AFR channel 0 ; Name = Channel, Title, Units, Lo, Hi, LoD, LoW, HiW, HiD, vd, ld, Active -AFR0_Gauge = AFR0_in, "0: AFR", "", 6.5, 20.0, 9.0, 10.0, 16.0, 17.0, 2, 2 -AFR0_TempGauge = AFR0_temp, "0: AFR t", "C", 500, 1050, 500, 650, 800, 950, 2, 2 -AFR0_NernstGauge = AFR0_Nernst, "0: nernst", "V", 0.0, 1.0, 0.0, 0.0, 0.9, 0.95, 2, 2 -AFR0_HeaterDutyGauge = AFR0_HeaterDuty, "0: Heater", "%", 0.0, 100.0, 1.0, 3.0, 90, 95, 2, 2 +AFR0_LambdaGauge = AFR0_lambda, "0: lambda", "", 0.5, 1.3, 0.5, 0.6, 1.05, 1.2, 3, 3 +AFR0_AfrGauge = AFR0_afr, "0: AFR", "", 6.5, 20.0, 9.0, 10.0, 16.0, 17.0, 2, 2 +AFR0_TempGauge = AFR0_temp, "0: AFR t", "C", 500, 1050, 500, 650, 800, 950, 0, 0 +AFR0_NernstGauge = AFR0_Nernst, "0: nernst", "V", 0.0, 1.0, 0.0, 0.0, 0.9, 0.95, 3, 3 +AFR0_HeaterDutyGauge = AFR0_HeaterDuty, "0: Heater Duty", "%", 0.0, 100.0, 1.0, 3.0, 90, 95, 1, 1 AFR0_PumpITargetGauge = AFR0_PumpITarget, "0: Ipump Target", "mA", -5.0, 5.0, -4.0, -3.0, 3.0, 4.0, 2, 2 AFR0_PumpIMeasureGauge = AFR0_PumpIMeasure, "0: Ipump Actual", "mA", -5.0, 5.0, -4.0, -3.0, 3.0, 4.0, 2, 2 -AFR0_FaultGauge = AFR0_fault, "0: AFR fault", "", 0.0, 6.0, 0.0, 0.0, 0.5, 0.5, 2, 2 -AFR0_HeaterGauge = AFR0_heater, "0: AFR heater state", "", 0.0, 4.0, 0.0, 1.5, 2.5, 2.5, 2, 2 [FrontPage] @@ -130,7 +127,7 @@ AFR0_HeaterGauge = AFR0_heater, "0: AFR heater state", "", ; 5 6 7 8 gauge1 = VBattGauge - gauge2 = AFR0_Gauge + gauge2 = AFR0_AfrGauge gauge3 = AFR0_TempGauge gauge4 = AFR0_HeaterDutyGauge gauge5 = AFR0_NernstGauge @@ -144,30 +141,28 @@ AFR0_HeaterGauge = AFR0_heater, "0: AFR heater state", "", [KeyActions] [Datalog] -; Channel Label Type Format -entry = time, "Time", float, "%.3f" +; Channel Label Type Format +entry = time, "Time", float, "%.3f" + +entry = VBatt "Battery", float, "%.2f" + +; AFR0 +entry = AFR0_lambda "0: Lambda", float, "%.3f" +entry = AFR0_afr "0: AFR", float, "%.2f" +entry = AFR0_temp "0: Temp C", int, "%d" +entry = AFR0_Nernst "0: Nernst", float, "%.3f" +entry = AFR0_PumpITarget "0: Ipump target", float, "%.2f" +entry = AFR0_PumpIMeasure "0: Ipump actual", float, "%.2f" +entry = AFR0_HeaterDuty "0: Heater duty", float, "%.1f" +entry = AFR0_fault "0: Fault code", int, "%d" +entry = AFR0_heater "0: Heater status code", int, "%d" [Menu] menuDialog = main - - menu = "&Base &Engine" - - menu = "Fuel" - - menu = "Ignition" - - menu = "&Cranking" - - menu = "&Idle" - - menu = "&View" + menu = "&Settings" subMenu = sensor_settings, "Sensor settings" - - - menu = "&Advanced" - - menu = "&Sensors" + subMenu = can_settings, "CAN settings" [ControllerCommands] ; commandName = command1, command2, commandn... @@ -186,4 +181,10 @@ cmd_dfu = "Z\x00\xba\x00\x00" [UserDefined] +dialog = sensor_settings, "Sensor Settings" + field = "Sensor Type", LsuSensorType + +dialog = can_settings, "CAN Settings" + field = "CAN message ID offset", CanIndexOffset + [Tools] diff --git a/firmware/ini/rusefi_wb_f1_dual.ini b/firmware/ini/rusefi_wb_f1_dual.ini index 8ffdee7..fe50d25 100644 --- a/firmware/ini/rusefi_wb_f1_dual.ini +++ b/firmware/ini/rusefi_wb_f1_dual.ini @@ -12,12 +12,12 @@ enable2ndByteCanID = false [MegaTune] ; https://rusefi.com/forum/viewtopic.php?p=36201#p36201 - signature = "rusEFI 2022.12.02.wideband_dual" + signature = "rusEFI 2022\.12\.06\.wideband_dual" [TunerStudio] queryCommand = "S" versionInfo = "V" ; firmware version for title bar. - signature = "rusEFI 2022.12.02.wideband_dual" ; signature is expected to be 7 or more characters. + signature = "rusEFI 2022\.12\.06\.wideband_dual" ; signature is expected to be 7 or more characters. ; TS will try to use legacy temp units in some cases, showing "deg F" on a CLT gauge that's actually deg C useLegacyFTempUnits = false @@ -70,8 +70,8 @@ Aux0OutBins = array, F32, 5, [8], "", 1, 0, 0, 1 Aux1OutBins = array, F32, 37, [8], "", 1, 0, 0, 1500, 2 Aux0Out = array, F32, 69, [8], "V", 1, 0, 0, 5.0, 2 Aux1Out = array, F32, 101, [8], "V", 1, 0, 0, 5.0, 2 -Aux0InputSel = bits, U08, 133, [0:3], "AFR 0", "AFR 1", "EGT 0", "EGT 1" -Aux1InputSel = bits, U08, 134, [0:3], "AFR 0", "AFR 1", "EGT 0", "EGT 1" +Aux0InputSel = bits, U08, 133, [0:3], "AFR 0", "AFR 1", "Lambda 0", "Lambda 1", "EGT 0", "EGT 1" +Aux1InputSel = bits, U08, 134, [0:3], "AFR 0", "AFR 1", "Lambda 0", "Lambda 1", "EGT 0", "EGT 1" LsuSensorType = bits, U08, 135, [0:2], "LSU 4.9", "LSU 4.2", "LSU ADV" [SettingContextHelp] @@ -86,42 +86,43 @@ LsuSensorType = bits, U08, 135, [0:2], "LSU 4.9", "LSU 4.2", "LSU ADV" ochBlockSize = 256 ; Common -VBatt = scalar, F32, 0, "V", 1, 0, 0.0, 30.0, 2 +VBatt = scalar, F32, 0, "V", 1, 0 ; AFR0 -AFR0_in = scalar, F32, 32, "", 14.7, 0, 0.0, 20.0, 2 -AFR0_temp = scalar, F32, 36, "C", 1, 0, 0.0, 1050.0, 0 -AFR0_Nernst = scalar, F32, 40, "V", 1, 0, 0.0, 1.0, 2 -AFR0_PumpITarget = scalar, F32, 44, "mA", 1, 0, -5.0, 5.0, 2 -AFR0_PumpIMeasure = scalar, F32, 48, "mA", 1, 0, -5.0, 5.0, 2 -AFR0_HeaterDuty = scalar, F32, 52, "%", 100, 0, 0.0, 100.0, 0 -AFR0_fault = scalar, U08, 56, "", 1, 0, 0, 6, 0 -AFR0_heater = scalar, U08, 57, "", 1, 0, 0, 4, 0 +AFR0_lambda = scalar, F32, 32, "", 1, 0 +AFR0_afr = scalar, F32, 32, "", 14.7, 0 +AFR0_temp = scalar, F32, 36, "C", 1, 0 +AFR0_Nernst = scalar, F32, 40, "V", 1, 0 +AFR0_PumpITarget = scalar, F32, 44, "mA", 1, 0 +AFR0_PumpIMeasure = scalar, F32, 48, "mA", 1, 0 +AFR0_HeaterDuty = scalar, F32, 52, "%", 100, 0 +AFR0_fault = scalar, U08, 56, "", 1, 0 +AFR0_heater = scalar, U08, 57, "", 1, 0 ; AFR1 -AFR1_in = scalar, F32, 64, "", 14.7, 0, 0.0, 20.0, 2 -AFR1_temp = scalar, F32, 68, "C", 1, 0, 0.0, 1050.0, 0 -AFR1_Nernst = scalar, F32, 72, "V", 1, 0, 0.0, 1.0, 2 -AFR1_PumpITarget = scalar, F32, 76, "mA", 1, 0, -5.0, 5.0, 2 -AFR1_PumpIMeasure = scalar, F32, 80, "mA", 1, 0, -5.0, 5.0, 2 -AFR1_HeaterDuty = scalar, F32, 84, "%", 100, 0, 0.0, 100.0, 0 -AFR1_fault = scalar, U08, 88, "", 1, 0, 0, 6, 0 -AFR1_heater = scalar, U08, 89, "", 1, 0, 0, 4, 0 +AFR1_lambda = scalar, F32, 64, "", 1, 0 +AFR1_afr = scalar, F32, 64, "", 14.7, 0 +AFR1_temp = scalar, F32, 68, "C", 1, 0 +AFR1_Nernst = scalar, F32, 72, "V", 1, 0 +AFR1_PumpITarget = scalar, F32, 76, "mA", 1, 0 +AFR1_PumpIMeasure = scalar, F32, 80, "mA", 1, 0 +AFR1_HeaterDuty = scalar, F32, 84, "%", 100, 0 +AFR1_fault = scalar, U08, 88, "", 1, 0 +AFR1_heater = scalar, U08, 89, "", 1, 0 ; EGT0 -EGT0_temp = scalar, F32, 96, "C", 1, 0, -250.0, 1600.0, 0 -EGT0_coldJunction = scalar, F32, 100, "C", 1, 0, -55.0, 127.0, 0 -EGT0_state = scalar, U08, 104, "", 1, 0, 0, 4, 0 +EGT0_temp = scalar, F32, 96, "C", 1, 0 +EGT0_coldJunction = scalar, F32, 100, "C", 1, 0 +EGT0_state = scalar, U08, 104, "", 1, 0 ; EGT1 -EGT1_temp = scalar, F32, 112, "C", 1, 0, -250.0, 1600.0, 0 -EGT1_coldJunction = scalar, F32, 116, "C", 1, 0, -55.0, 127.0, 0 -EGT1_state = scalar, U08, 120, "", 1, 0, 0, 4, 0 +EGT1_temp = scalar, F32, 112, "C", 1, 0 +EGT1_coldJunction = scalar, F32, 116, "C", 1, 0 +EGT1_state = scalar, U08, 120, "", 1, 0 -seconds = scalar, U32, 124, "sec", 1, 0 - -Aux0InputSig = { (Aux0InputSel == 0) ? AFR0_in : ((Aux0InputSel == 1) ? AFR1_in : ((Aux0InputSel == 2) ? EGT0_temp : EGT1_temp)) } -Aux1InputSig = { (Aux1InputSel == 0) ? AFR0_in : ((Aux1InputSel == 1) ? AFR1_in : ((Aux1InputSel == 2) ? EGT0_temp : EGT1_temp)) } +; TODO: something is wrong with these +Aux0InputSig = { (Aux0InputSel == 0) ? AFR0_lambda : ((Aux0InputSel == 1) ? AFR1_lambda : ((Aux0InputSel == 2) ? EGT0_temp : EGT1_temp)) } +Aux1InputSig = { (Aux1InputSel == 0) ? AFR0_lambda : ((Aux1InputSel == 1) ? AFR1_lambda : ((Aux1InputSel == 2) ? EGT0_temp : EGT1_temp)) } ;Aux0InputSigMax = { (Aux0InputSel == 0) ? 25 : ((Aux0InputSel == 1) ? 25 : 1500 } ;Aux1InputSigMax = { (Aux1InputSel == 0) ? 25 : ((Aux1InputSel == 1) ? 25 : 1500 } @@ -157,49 +158,47 @@ Aux1InputSig = { (Aux1InputSel == 0) ? AFR0_in : ((Aux1InputSel == 1) ? AFR1_in gaugeCategory = Common ; Name = Channel, Title, Units, Lo, Hi, LoD, LoW, HiW, HiD, vd, ld, Active -VBattGauge = VBatt, "Battery", "V", 3.0, 24.0, 9.0, 11.0, 15.0, 16.0, 2, 2 +VBattGauge = VBatt, "Battery", "V", 3.0, 24.0, 9.0, 11.0, 15.0, 16.0, 1, 1 ; AFR0 gaugeCategory = AFR channel 0 ; Name = Channel, Title, Units, Lo, Hi, LoD, LoW, HiW, HiD, vd, ld, Active -AFR0_Gauge = AFR0_in, "0: AFR", "", 6.5, 20.0, 9.0, 10.0, 16.0, 17.0, 2, 2 -AFR0_TempGauge = AFR0_temp, "0: AFR t", "C", 500, 1050, 500, 650, 800, 950, 2, 2 -AFR0_NernstGauge = AFR0_Nernst, "0: nernst", "V", 0.0, 1.0, 0.0, 0.0, 0.9, 0.95, 2, 2 -AFR0_HeaterDutyGauge = AFR0_HeaterDuty, "0: Heater", "%", 0.0, 100.0, 1.0, 3.0, 90, 95, 2, 2 +AFR0_LambdaGauge = AFR0_lambda, "0: lambda", "", 0.5, 1.3, 0.5, 0.6, 1.05, 1.2, 3, 3 +AFR0_AfrGauge = AFR0_afr, "0: AFR", "", 6.5, 20.0, 9.0, 10.0, 16.0, 17.0, 2, 2 +AFR0_TempGauge = AFR0_temp, "0: AFR t", "C", 500, 1050, 500, 650, 800, 950, 0, 0 +AFR0_NernstGauge = AFR0_Nernst, "0: nernst", "V", 0.0, 1.0, 0.0, 0.0, 0.9, 0.95, 3, 3 +AFR0_HeaterDutyGauge = AFR0_HeaterDuty, "0: Heater Duty", "%", 0.0, 100.0, 1.0, 3.0, 90, 95, 1, 1 AFR0_PumpITargetGauge = AFR0_PumpITarget, "0: Ipump Target", "mA", -5.0, 5.0, -4.0, -3.0, 3.0, 4.0, 2, 2 AFR0_PumpIMeasureGauge = AFR0_PumpIMeasure, "0: Ipump Actual", "mA", -5.0, 5.0, -4.0, -3.0, 3.0, 4.0, 2, 2 -AFR0_FaultGauge = AFR0_fault, "0: AFR fault", "", 0.0, 6.0, 0.0, 0.0, 0.5, 0.5, 2, 2 -AFR0_HeaterGauge = AFR0_heater, "0: AFR heater state", "", 0.0, 4.0, 0.0, 1.5, 2.5, 2.5, 2, 2 ; AFR1 gaugeCategory = AFR channel 1 ; Name = Channel, Title, Units, Lo, Hi, LoD, LoW, HiW, HiD, vd, ld, Active -AFR1_Gauge = AFR1_in, "1: AFR", "", 6.5, 20.0, 9.0, 10.0, 16.0, 17.0, 2, 2 -AFR1_TempGauge = AFR1_temp, "1: AFR t", "C", 500, 1050, 500, 650, 800, 950, 2, 2 -AFR1_NernstGauge = AFR1_Nernst, "1: nernst", "V", 0.0, 1.0, 0.0, 0.0, 0.9, 0.95, 2, 2 -AFR1_HeaterDutyGauge = AFR1_HeaterDuty, "1: Heater", "%", 0.0, 100.0, 1.0, 3.0, 90, 95, 2, 2 +AFR1_LambdaGauge = AFR1_lambda, "1: lambda", "", 0.5, 1.3, 0.5, 0.6, 1.05, 1.2, 3, 3 +AFR1_AfrGauge = AFR1_afr, "1: AFR", "", 6.5, 20.0, 9.0, 10.0, 16.0, 17.0, 2, 2 +AFR1_TempGauge = AFR1_temp, "1: AFR t", "C", 500, 1050, 500, 650, 800, 950, 0, 0 +AFR1_NernstGauge = AFR1_Nernst, "1: nernst", "V", 0.0, 1.0, 0.0, 0.0, 0.9, 0.95, 3, 3 +AFR1_HeaterDutyGauge = AFR1_HeaterDuty, "1: Heater Duty", "%", 0.0, 100.0, 1.0, 3.0, 90, 95, 1, 1 AFR1_PumpITargetGauge = AFR1_PumpITarget, "1: Ipump Target", "mA", -5.0, 5.0, -4.0, -3.0, 3.0, 4.0, 2, 2 AFR1_PumpIMeasureGauge = AFR1_PumpIMeasure, "1: Ipump Actual", "mA", -5.0, 5.0, -4.0, -3.0, 3.0, 4.0, 2, 2 -AFR1_FaultGauge = AFR1_fault, "1: AFR fault", "", 0.0, 6.0, 0.0, 0.0, 0.5, 0.5, 2, 2 -AFR1_HeaterGauge = AFR1_heater, "1: AFR heater state", "", 0.0, 4.0, 0.0, 1.5, 2.5, 2.5, 2, 2 ; EGT0 gaugeCategory = EGT channel 0 ; Name = Channel, Title, Units, Lo, Hi, LoD, LoW, HiW, HiD, vd, ld, Active -EGT0_Gauge = EGT0_temp, "0: EGT", "C", 0.0, 1600.0, 100.0, 250.0, 900.0, 1000.0, 2, 2 -EGT0_ColdJunctionGauge = EGT0_coldJunction, "0: EGT CJ", "C", 0.0, 130.0, -55.0, -20.0, 95.0, 105.0, 2, 2 -EGT0_StateGauge = EGT0_state, "0: EGT state", "", 0.0, 5.0, 0.0, 0.0, 0.5, 0.5, 2, 2 +EGT0_Gauge = EGT0_temp, "0: EGT", "C", 0.0, 1600.0, 100.0, 250.0, 900.0, 1000.0, 0, 0 +EGT0_ColdJunctionGauge = EGT0_coldJunction, "0: EGT CJ", "C", 0.0, 130.0, -55.0, -20.0, 95.0, 105.0, 1, 1 +EGT0_StateGauge = EGT0_state, "0: EGT state", "", 0.0, 5.0, 0.0, 0.0, 0.5, 0.5, 0, 0 ; EGT1 gaugeCategory = EGT channel 1 ; Name = Channel, Title, Units, Lo, Hi, LoD, LoW, HiW, HiD, vd, ld, Active -EGT1_Gauge = EGT1_temp, "1: EGT", "C", 0.0, 1600.0, 100.0, 250.0, 900.0, 1000.0, 2, 2 -EGT1_ColdJunctionGauge = EGT1_coldJunction, "1: EGT CJ", "C", 0.0, 130.0, -55.0, -20.0, 95.0, 105.0, 2, 2 -EGT1_StateGauge = EGT1_state, "1: EGT state", "", 0.0, 5.0, 0.0, 0.0, 0.5, 0.5, 2, 2 +EGT1_Gauge = EGT1_temp, "1: EGT", "C", 0.0, 1600.0, 100.0, 250.0, 900.0, 1000.0, 0, 0 +EGT1_ColdJunctionGauge = EGT1_coldJunction, "1: EGT CJ", "C", 0.0, 130.0, -55.0, -20.0, 95.0, 105.0, 1, 1 +EGT1_StateGauge = EGT1_state, "1: EGT state", "", 0.0, 5.0, 0.0, 0.0, 0.5, 0.5, 0, 0 ; AUX outputs -Aux0InputGauge = { (Aux0InputSel == 0) ? AFR0_Gauge : ((Aux0InputSel == 1) ? AFR1_Gauge : ((Aux0InputSel == 2) ? EGT0_Gauge : EGT1_Gauge)) } -Aux1InputGauge = { (Aux1InputSel == 0) ? AFR0_Gauge : ((Aux1InputSel == 1) ? AFR1_Gauge : ((Aux1InputSel == 2) ? EGT0_Gauge : EGT1_Gauge)) } +Aux0InputGauge = { (Aux0InputSel == 0) ? AFR0_AfrGauge : ((Aux0InputSel == 1) ? AFR1_AfrGauge : ((Aux0InputSel == 2) ? EGT0_Gauge : EGT1_Gauge)) } +Aux1InputGauge = { (Aux1InputSel == 0) ? AFR0_AfrGauge : ((Aux1InputSel == 1) ? AFR1_AfrGauge : ((Aux1InputSel == 2) ? EGT0_Gauge : EGT1_Gauge)) } [FrontPage] ; Gauges are numbered left to right, top to bottom. @@ -208,8 +207,8 @@ Aux1InputGauge = { (Aux1InputSel == 0) ? AFR0_Gauge : ((Aux1InputSel == 1) ? AFR ; 5 6 7 8 gauge1 = AFR0_TempGauge - gauge2 = AFR0_Gauge - gauge3 = AFR1_Gauge + gauge2 = AFR0_AfrGauge + gauge3 = AFR1_AfrGauge gauge4 = AFR1_TempGauge gauge5 = VBattGauge gauge6 = EGT0_Gauge @@ -226,24 +225,47 @@ Aux1InputGauge = { (Aux1InputSel == 0) ? AFR0_Gauge : ((Aux1InputSel == 1) ? AFR [KeyActions] [Datalog] -; Channel Label Type Format -entry = time, "Time", float, "%.3f" +; Channel Label Type Format +entry = time, "Time", float, "%.3f" + +entry = VBatt "Battery", float, "%.2f" + +; AFR0 +entry = AFR0_lambda "0: Lambda", float, "%.3f" +entry = AFR0_afr "0: AFR", float, "%.2f" +entry = AFR0_temp "0: Temp C", int, "%d" +entry = AFR0_Nernst "0: Nernst", float, "%.3f" +entry = AFR0_PumpITarget "0: Ipump target", float, "%.2f" +entry = AFR0_PumpIMeasure "0: Ipump actual", float, "%.2f" +entry = AFR0_HeaterDuty "0: Heater duty", float, "%.1f" +entry = AFR0_fault "0: Fault code", int, "%d" +entry = AFR0_heater "0: Heater status code", int, "%d" + +; AFR1 +entry = AFR1_lambda "1: Lambda", float, "%.3f" +entry = AFR1_afr "1: AFR", float, "%.2f" +entry = AFR1_temp "1: Temp C", int, "%d" +entry = AFR1_Nernst "1: Nernst", float, "%.3f" +entry = AFR1_PumpITarget "1: Ipump target", float, "%.2f" +entry = AFR1_PumpIMeasure "1: Ipump actual", float, "%.2f" +entry = AFR1_HeaterDuty "1: Heater duty", float, "%.1f" +entry = AFR1_fault "1: Fault code", int, "%d" +entry = AFR1_heater "1: Heater status code", int, "%d" + +; EGT0 +entry = EGT0_temp "EGT 0: EGT", int, "%d" +entry = EGT0_coldJunction "EGT 0: CJ", int, "%d" +entry = EGT0_state "EGT 0: State", int, "%d" + +; EGT1 +entry = EGT1_temp "EGT 1: EGT", int, "%d" +entry = EGT1_coldJunction "EGT 1: CJ", int, "%d" +entry = EGT1_state "EGT 1: State", int, "%d" [Menu] menuDialog = main - - menu = "&Base &Engine" - - menu = "Fuel" - - menu = "Ignition" - - menu = "&Cranking" - - menu = "&Idle" - - menu = "&View" + menu = "&Settings" subMenu = sensor_settings, "Sensor settings" subMenu = can_settings, "CAN settings" @@ -251,10 +273,6 @@ menuDialog = main subMenu = auxOut0, "AUX analog output 0" subMenu = auxOut1, "AUX analog output 1" - menu = "&Advanced" - - menu = "&Sensors" - [ControllerCommands] ; commandName = command1, command2, commandn... ; command in standard ini format, a command name can be assigned to 1 to n commands that will be executed in order. diff --git a/firmware/livedata.cpp b/firmware/livedata.cpp index 77ca9a6..decfd3c 100644 --- a/firmware/livedata.cpp +++ b/firmware/livedata.cpp @@ -20,7 +20,7 @@ void SamplingUpdateLiveData() { volatile struct livedata_afr_s *data = &livedata_afr[ch]; - data->afr = GetLambda(ch); + data->lambda = GetLambda(ch); data->temperature = GetSensorTemperature(ch); data->nernstVoltage = GetNernstDc(ch); data->pumpCurrentTarget = GetPumpCurrent(ch); diff --git a/firmware/livedata.h b/firmware/livedata.h index b4f5e3e..4dd2183 100644 --- a/firmware/livedata.h +++ b/firmware/livedata.h @@ -20,7 +20,8 @@ struct livedata_common_s { struct livedata_afr_s { union { struct { - float afr; + // lambda also displayed by TS as AFR, same data with different scale factor + float lambda; float temperature; float nernstVoltage; float pumpCurrentTarget;