TS: report Nernst AC too, convert Nernst voltages to uint16 (#249)

* TS: report Nernst AC too, convert Nernst voltages to uint16

* TS: report Nernst AC too, convert Nernst voltages to uint16

---------

Co-authored-by: Andrey Gusakov <dron0gus@gmail.com>
Co-authored-by: rusefillc <sdfsdfqsf2334234234>
This commit is contained in:
rusefillc 2023-05-03 17:51:34 -04:00 committed by GitHub
parent 9519ad51dd
commit 94de9fd776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 19 deletions

View File

@ -1,7 +1,7 @@
#pragma once
// TS settings
#define TS_SIGNATURE "rusEFI 2022.12.06.wideband_dual"
#define TS_SIGNATURE "rusEFI 2023.03.23.wideband_dual"
// This board implements two channels
#define AFR_CHANNELS 2

View File

@ -1,7 +1,7 @@
#pragma once
// TS settings
#define TS_SIGNATURE "rusEFI 2022.12.06.wideband_f1"
#define TS_SIGNATURE "rusEFI 2023.03.23.wideband_f1"
// Fundamental board constants
#define VCC_VOLTS (3.3f)

View File

@ -1,7 +1,7 @@
#pragma once
// TS settings
#define TS_SIGNATURE "rusEFI 2022.12.06.wideband_f1"
#define TS_SIGNATURE "rusEFI 2023.03.23.wideband_f1"
// Fundamental board constants
#define VCC_VOLTS (3.3f)

View File

@ -12,12 +12,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2022.12.06.wideband_dual"
signature = "rusEFI 2023.03.23.wideband_dual"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmware version for title bar.
signature = "rusEFI 2022.12.06.wideband_dual" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2023.03.23.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
@ -97,7 +97,8 @@ VBatt = scalar, F32, 0, "V", 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_NernstDc = scalar, U16, 40, "V", 0.001, 0
AFR0_NernstAc = scalar, U16, 42, "V", 0.001, 0
AFR0_PumpITarget = scalar, F32, 44, "mA", 1, 0
AFR0_PumpIMeasure = scalar, F32, 48, "mA", 1, 0
AFR0_HeaterDuty = scalar, U16, 52, "%", 0.1, 0
@ -110,7 +111,8 @@ AFR0_heater = scalar, U08, 61, "", 1, 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_NernstDc = scalar, U16, 72, "V", 0.001, 0
AFR1_NernstAc = scalar, U16, 74, "V", 0.001, 0
AFR1_PumpITarget = scalar, F32, 76, "mA", 1, 0
AFR1_PumpIMeasure = scalar, F32, 80, "mA", 1, 0
AFR1_HeaterDuty = scalar, U16, 84, "%", 0.1, 0
@ -175,7 +177,8 @@ gaugeCategory = AFR channel 0
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_NernstDcGauge = AFR0_NernstDc, "0: nernst DC", "V", 0.0, 1.0, 0.0, 0.0, 0.9, 0.95, 3, 3
AFR0_NernstAcGauge = AFR0_NernstAc, "0: nernst AC", "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_HeaterEffVGauge = AFR0_HeaterEffV, "0: Heater Voltage", "V", 0.0, 18.0, 1.5, 6.0, 9, 16, 1, 1
AFR0_PumpITargetGauge = AFR0_PumpITarget, "0: Ipump Target", "mA", -5.0, 5.0, -4.0, -3.0, 3.0, 4.0, 2, 2
@ -188,7 +191,8 @@ gaugeCategory = AFR channel 1
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_NernstDcGauge = AFR1_NernstDc, "1: nernst DC", "V", 0.0, 1.0, 0.0, 0.0, 0.9, 0.95, 3, 3
AFR1_NernstAcGauge = AFR1_NernstAc, "1: nernst AC", "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_HeaterEffVGauge = AFR1_HeaterEffV, "1: Heater Voltage", "V", 0.0, 18.0, 1.5, 6.0, 9, 16, 1, 1
AFR1_PumpITargetGauge = AFR1_PumpITarget, "1: Ipump Target", "mA", -5.0, 5.0, -4.0, -3.0, 3.0, 4.0, 2, 2
@ -248,7 +252,8 @@ entry = VBatt, "Battery", float, "%.2f"
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_NernstDc, "0: Nernst DC", float, "%.3f"
entry = AFR0_NernstAc, "0: Nernst AC", 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"
@ -261,7 +266,8 @@ entry = AFR0_esr, "0: ESR", float, "%.1f"
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_NernstDc, "1: Nernst DC", float, "%.3f"
entry = AFR1_NernstAc, "1: Nernst AC", 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"

View File

@ -12,12 +12,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2022.12.06.wideband_f1"
signature = "rusEFI 2023.03.23.wideband_f1"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmware version for title bar.
signature = "rusEFI 2022.12.06.wideband_f1" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2023.03.23.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
@ -90,7 +90,8 @@ VBatt = scalar, F32, 0, "V", 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_NernstDc = scalar, U16, 40, "V", 0.001, 0
AFR0_NernstAc = scalar, U16, 42, "V", 0.001, 0
AFR0_PumpITarget = scalar, F32, 44, "mA", 1, 0
AFR0_PumpIMeasure = scalar, F32, 48, "mA", 1, 0
AFR0_HeaterDuty = scalar, U16, 52, "%", 0.1, 0
@ -121,7 +122,8 @@ gaugeCategory = AFR channel 0
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_NernstDcGauge = AFR0_NernstDc, "0: nernst DC", "V", 0.0, 1.0, 0.0, 0.0, 0.9, 0.95, 3, 3
AFR0_NernstAcGauge = AFR0_NernstAc, "0: nernst AC", "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_HeaterEffVGauge = AFR0_HeaterEffV, "0: Heater Voltage", "V", 0.0, 18.0, 1.5, 6.0, 9, 16, 1, 1
AFR0_PumpITargetGauge = AFR0_PumpITarget, "0: Ipump Target", "mA", -5.0, 5.0, -4.0, -3.0, 3.0, 4.0, 2, 2
@ -138,7 +140,7 @@ AFR0_EsrGauge = AFR0_esr, "0: ESR", "ohms",
gauge2 = AFR0_AfrGauge
gauge3 = AFR0_TempGauge
gauge4 = AFR0_HeaterDutyGauge
gauge5 = AFR0_NernstGauge
gauge5 = AFR0_NernstDcGauge
gauge6 = AFR0_PumpITargetGauge
gauge7 = AFR0_PumpIMeasureGauge
gauge8 = AFR0_EsrGauge
@ -159,7 +161,8 @@ entry = VBatt, "Battery", float, "%.2f"
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_NernstDc, "0: Nernst DC", float, "%.3f"
entry = AFR0_NernstAc, "0: Nernst AC", 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"

View File

@ -22,7 +22,8 @@ void SamplingUpdateLiveData()
data->lambda = GetLambda(ch);
data->temperature = GetSensorTemperature(ch);
data->nernstVoltage = GetNernstDc(ch);
data->nernstDc = GetNernstDc(ch) * 1000;
data->nernstAc = GetNernstAc(ch) * 1000;
data->pumpCurrentTarget = GetPumpCurrent(ch);
data->pumpCurrentMeasured = GetPumpNominalCurrent(ch);
data->heaterDuty = GetHeaterDuty(ch) * 1000; // 0.1 %

View File

@ -23,7 +23,8 @@ struct livedata_afr_s {
// lambda also displayed by TS as AFR, same data with different scale factor
float lambda;
float temperature;
float nernstVoltage;
uint16_t nernstDc;
uint16_t nernstAc;
float pumpCurrentTarget;
float pumpCurrentMeasured;
uint16_t heaterDuty;