diff --git a/firmware/ini/rusefi_wb_f1.ini b/firmware/ini/rusefi_wb_f1.ini index 5bf3303..003cd68 100644 --- a/firmware/ini/rusefi_wb_f1.ini +++ b/firmware/ini/rusefi_wb_f1.ini @@ -86,8 +86,9 @@ 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 +AFR0_esr = scalar, F32, 56, "ohms", 1, 0 +AFR0_fault = scalar, U08, 60, "", 1, 0 +AFR0_heater = scalar, U08, 61, "", 1, 0 [PcVariables] ; Keep in sync with Max31855State enum from max31855.h @@ -115,7 +116,7 @@ AFR0_NernstGauge = AFR0_Nernst, "0: nernst", "V", 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_EsrGauge = AFR0_esr, "0: ESR", "ohms", 0, 600, 200, 200, 350, 400, 0, 0 [FrontPage] ; Gauges are numbered left to right, top to bottom. @@ -141,18 +142,19 @@ AFR0_PumpIMeasureGauge = AFR0_PumpIMeasure, "0: Ipump Actual", "mA", - ; Channel Label Type Format entry = time, "Time", float, "%.3f" -entry = VBatt "Battery", float, "%.2f" +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" +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" +entry = AFR0_esr, "0: ESR", float, "%.1f" [Menu] diff --git a/firmware/ini/rusefi_wb_f1_dual.ini b/firmware/ini/rusefi_wb_f1_dual.ini index ad11d0f..7aa1dc6 100644 --- a/firmware/ini/rusefi_wb_f1_dual.ini +++ b/firmware/ini/rusefi_wb_f1_dual.ini @@ -93,8 +93,9 @@ 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 +AFR0_esr = scalar, F32, 56, "ohms", 1, 0 +AFR0_fault = scalar, U08, 60, "", 1, 0 +AFR0_heater = scalar, U08, 61, "", 1, 0 ; AFR1 AFR1_lambda = scalar, F32, 64, "", 1, 0 @@ -104,8 +105,9 @@ 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 +AFR1_esr = scalar, F32, 88, "ohms", 1, 0 +AFR1_fault = scalar, U08, 92, "", 1, 0 +AFR1_heater = scalar, U08, 93, "", 1, 0 ; EGT0 EGT0_temp = scalar, F32, 96, "C", 1, 0 @@ -167,6 +169,7 @@ AFR0_NernstGauge = AFR0_Nernst, "0: nernst", "V", 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_EsrGauge = AFR0_esr, "0: ESR", "ohms", 0, 600, 200, 200, 350, 400, 0, 0 ; AFR1 gaugeCategory = AFR channel 1 @@ -178,6 +181,7 @@ AFR1_NernstGauge = AFR1_Nernst, "1: nernst", "V", 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_EsrGauge = AFR1_esr, "1: ESR", "ohms", 0, 600, 200, 200, 350, 400, 0, 0 ; EGT0 gaugeCategory = EGT channel 0 @@ -225,39 +229,41 @@ Aux1InputGauge = { (Aux1InputSel == 0) ? AFR0_AfrGauge : ((Aux1InputSel == 1) ? ; Channel Label Type Format entry = time, "Time", float, "%.3f" -entry = VBatt "Battery", float, "%.2f" +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" +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" +entry = AFR0_esr, "0: ESR", float, "%.1f" ; 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" +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" +entry = AFR1_esr, "1: ESR", float, "%.1f" ; 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" +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" +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] diff --git a/firmware/livedata.cpp b/firmware/livedata.cpp index decfd3c..036f65a 100644 --- a/firmware/livedata.cpp +++ b/firmware/livedata.cpp @@ -26,6 +26,7 @@ void SamplingUpdateLiveData() data->pumpCurrentTarget = GetPumpCurrent(ch); data->pumpCurrentMeasured = GetPumpNominalCurrent(ch); data->heaterDuty = GetHeaterDuty(ch); + data->esr = GetSensorInternalResistance(ch); data->fault = (uint8_t)GetCurrentFault(ch); data->heaterState = (uint8_t)GetHeaterState(ch); } diff --git a/firmware/livedata.h b/firmware/livedata.h index 4dd2183..7636f70 100644 --- a/firmware/livedata.h +++ b/firmware/livedata.h @@ -27,6 +27,7 @@ struct livedata_afr_s { float pumpCurrentTarget; float pumpCurrentMeasured; float heaterDuty; + float esr; uint8_t fault; // See wbo::Fault uint8_t heaterState; } __attribute__((packed));