Fix LBC temperatures

This commit is contained in:
Carsten Schmiemann 2022-04-16 21:32:07 +02:00
parent afce8ca44b
commit 6877d46549
2 changed files with 32 additions and 35 deletions

View file

@ -34,13 +34,12 @@ void OvmsVehicleRenaultZoePh2::IncomingLBC(uint16_t type, uint16_t pid, const ch
} }
case 0x925D: { //Battery current case 0x925D: { //Battery current
StandardMetrics.ms_v_bat_current->SetValue((float) (CAN_UINT(0) * 0.03125 - 1020), Amps); StandardMetrics.ms_v_bat_current->SetValue((float) (CAN_UINT(0) * 0.03125 - 1020), Amps);
ESP_LOGD(TAG, "925D LBC ms_v_bat_current: %d", CAN_UINT(0));
ESP_LOGD(TAG, "925D LBC ms_v_bat_current: %f", (CAN_UINT(0) * 0.03125 - 1020)); ESP_LOGD(TAG, "925D LBC ms_v_bat_current: %f", (CAN_UINT(0) * 0.03125 - 1020));
break; break;
} }
case 0x9012: { //Battery average temperature case 0x9012: { //Battery average temperature
StandardMetrics.ms_v_bat_temp->SetValue((float) (CAN_UINT(0) * 0.625 - 40), Celcius); StandardMetrics.ms_v_bat_temp->SetValue((float) (CAN_UINT(0) * 0.0625 - 40), Celcius);
ESP_LOGD(TAG, "9012 LBC ms_v_bat_temp: %f", (CAN_UINT(0) * 0.625 - 40)); ESP_LOGD(TAG, "9012 LBC ms_v_bat_temp: %f", (CAN_UINT(0) * 0.0625 - 40));
break; break;
} }
case 0x9002: { //Battery SOC case 0x9002: { //Battery SOC
@ -79,15 +78,13 @@ void OvmsVehicleRenaultZoePh2::IncomingLBC(uint16_t type, uint16_t pid, const ch
break; break;
} }
case 0x9014: { //Cell Max Temp case 0x9014: { //Cell Max Temp
StandardMetrics.ms_v_bat_pack_tmax->SetValue((float) (CAN_UINT(0) * 0.625 - 40), Celcius); StandardMetrics.ms_v_bat_pack_tmax->SetValue((float) (CAN_UINT(0) * 0.0625 - 40), Celcius);
ESP_LOGD(TAG, "9014 LBC ms_v_bat_pack_tmax RAW: %d", CAN_UINT(0)); ESP_LOGD(TAG, "9014 LBC ms_v_bat_pack_tmax: %f", CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "9014 LBC ms_v_bat_pack_tmax: %f", CAN_UINT(0) * 0.625 - 40);
break; break;
} }
case 0x9013: { //Cell Min Temp case 0x9013: { //Cell Min Temp
StandardMetrics.ms_v_bat_pack_tmin->SetValue((float) (CAN_UINT(0) * 0.625 - 40), Celcius); StandardMetrics.ms_v_bat_pack_tmin->SetValue((float) (CAN_UINT(0) * 0.0625 - 40), Celcius);
ESP_LOGD(TAG, "9013 LBC ms_v_bat_pack_tmin RAW: %d", CAN_UINT(0)); ESP_LOGD(TAG, "9013 LBC ms_v_bat_pack_tmin: %f", CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "9013 LBC ms_v_bat_pack_tmin: %f", CAN_UINT(0) * 0.625 - 40);
break; break;
} }
case 0x9018: { //Max charge power case 0x9018: { //Max charge power
@ -101,63 +98,63 @@ void OvmsVehicleRenaultZoePh2::IncomingLBC(uint16_t type, uint16_t pid, const ch
break; break;
} }
case 0x9131: { case 0x9131: {
BmsSetCellTemperature(1, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(1, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x9132: { case 0x9132: {
BmsSetCellTemperature(2, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(2, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x9133: { case 0x9133: {
BmsSetCellTemperature(3, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(3, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x9134: { case 0x9134: {
BmsSetCellTemperature(4, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(4, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x9135: { case 0x9135: {
BmsSetCellTemperature(5, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(5, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x9136: { case 0x9136: {
BmsSetCellTemperature(6, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(6, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x9137: { case 0x9137: {
BmsSetCellTemperature(7, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(7, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x9138: { case 0x9138: {
BmsSetCellTemperature(8, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(8, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x9139: { case 0x9139: {
BmsSetCellTemperature(9, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(9, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x913A: { case 0x913A: {
BmsSetCellTemperature(10, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(10, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x913B: { case 0x913B: {
BmsSetCellTemperature(11, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(11, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x913C: { case 0x913C: {
BmsSetCellTemperature(12, CAN_UINT(0) * 0.625 - 40); BmsSetCellTemperature(12, CAN_UINT(0) * 0.0625 - 40);
ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.625 - 40); ESP_LOGD(TAG, "%x: %f C", pid, CAN_UINT(0) * 0.0625 - 40);
break; break;
} }
case 0x9021: { case 0x9021: {

View file

@ -56,7 +56,7 @@ static const OvmsVehicle::poll_pid_t renault_zoe_polls[] = {
{ 0x18dadaf1, 0x18daf1da, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x2191, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Power usage by ptc { 0x18dadaf1, 0x18daf1da, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x2191, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // Power usage by ptc
//BCM //BCM
//{ 0x1861, 0x1893, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_DEFAULT, { 60, 60, 60, 60 }, 0, ISOTP_EXTFRAME }, // OBD Extended Diagnostic Session { 0x1861, 0x1893, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_DEFAULT, { 60, 60, 60, 60 }, 0, ISOTP_EXTFRAME }, // OBD Extended Diagnostic Session
{ 0x1861, 0x1893, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4204, { 0, 300, 300, 300 }, 0, ISOTP_EXTADR }, // TPMS pressure - front left { 0x1861, 0x1893, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4204, { 0, 300, 300, 300 }, 0, ISOTP_EXTADR }, // TPMS pressure - front left
{ 0x1861, 0x1893, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4205, { 0, 300, 300, 300 }, 0, ISOTP_EXTADR }, // TPMS pressure - front right { 0x1861, 0x1893, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4205, { 0, 300, 300, 300 }, 0, ISOTP_EXTADR }, // TPMS pressure - front right
{ 0x1861, 0x1893, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4206, { 0, 300, 300, 300 }, 0, ISOTP_EXTADR }, // TPMS pressure - rear left { 0x1861, 0x1893, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4206, { 0, 300, 300, 300 }, 0, ISOTP_EXTADR }, // TPMS pressure - rear left
@ -201,7 +201,7 @@ static const OvmsVehicle::poll_pid_t renault_zoe_polls[] = {
{ 0x1860, 0x1892, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x43D8, { 0, 3, 10, 10 }, 0, ISOTP_EXTADR }, // Compressor speed { 0x1860, 0x1892, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x43D8, { 0, 3, 10, 10 }, 0, ISOTP_EXTADR }, // Compressor speed
//UCM //UCM
//{ 0x1869, 0x1901, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_EXTDIAG, { 60, 60, 60, 60 }, 0, ISOTP_EXTADR }, // OBD Extended Diagnostic Session { 0x1869, 0x1901, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_EXTDIAG, { 0, 60, 60, 60 }, 0, ISOTP_EXTADR }, // OBD Extended Diagnostic Session
{ 0x1869, 0x1901, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x6079, { 0, 10, 5, 3 }, 0, ISOTP_EXTFRAME }, // 12V Battery current { 0x1869, 0x1901, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x6079, { 0, 10, 5, 3 }, 0, ISOTP_EXTFRAME }, // 12V Battery current
POLL_LIST_END POLL_LIST_END
}; };