mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Convert more of send-all branch to main
This commit is contained in:
parent
e15f28ec40
commit
3a6c3904c4
4 changed files with 837 additions and 568 deletions
|
@ -451,6 +451,28 @@ void generateFrameCounterChecksum(CAN_frame& f,
|
|||
setBitField(data, bytes, csumStartBit, csumBitLength, checksum);
|
||||
}
|
||||
|
||||
// Function to extract raw bits/values from a given CAN frame signal
|
||||
inline uint64_t extract_signal_value(const uint8_t* data, uint32_t start_bit, uint32_t bit_length) {
|
||||
//
|
||||
// Usage: uint8_t bms_state = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 31, 4));
|
||||
//
|
||||
// Calculate the starting byte and bit offset
|
||||
uint32_t byte_index = start_bit / 8;
|
||||
uint32_t bit_offset = start_bit % 8;
|
||||
|
||||
// Read up to 8 bytes starting from byte_index (need enough to cover bit_length + bit_offset)
|
||||
uint64_t raw = 0;
|
||||
for (int i = 0; i < 8 && (byte_index + i) < 64; ++i) {
|
||||
raw |= (uint64_t)data[byte_index + i] << (8 * i);
|
||||
}
|
||||
|
||||
// Shift and mask
|
||||
raw >>= bit_offset;
|
||||
if (bit_length == 64)
|
||||
return raw;
|
||||
return raw & ((1ULL << bit_length) - 1);
|
||||
}
|
||||
|
||||
// Function to write a value to a given CAN frame signal
|
||||
void write_signal_value(CAN_frame* frame, uint16_t start_bit, uint8_t bit_length, int64_t value, bool is_signed) {
|
||||
if (bit_length == 0 || bit_length > 64 || frame == nullptr)
|
||||
|
@ -692,12 +714,19 @@ void TeslaBattery::
|
|||
datalayer.battery.settings.user_requests_tesla_isolation_clear = false;
|
||||
}
|
||||
if (datalayer.battery.settings.user_requests_tesla_bms_reset) {
|
||||
if (battery_contactor == 1 && battery_BMS_a180_SW_ECU_reset_blocked == false) {
|
||||
if (battery_contactor == 1 && BMS_a180_SW_ECU_reset_blocked == false) {
|
||||
//Start the BMS ECU reset statemachine, only if contactors are OPEN and BMS ECU allows it
|
||||
stateMachineBMSReset = 0;
|
||||
datalayer.battery.settings.user_requests_tesla_bms_reset = false;
|
||||
#ifdef DEBUG_LOG
|
||||
logging.println("BMS reset requested");
|
||||
#endif //DEBUG_LOG
|
||||
} else {
|
||||
#ifdef DEBUG_LOG
|
||||
logging.println("ERROR: BMS reset failed due to contactors not being open, or BMS ECU not allowing it");
|
||||
#endif //DEBUG_LOG
|
||||
stateMachineBMSReset = 0;
|
||||
datalayer.battery.settings.user_requests_tesla_bms_reset = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -706,13 +735,13 @@ void TeslaBattery::
|
|||
write_signal_value(&TESLA_333, 16, 10, static_cast<int64_t>(datalayer.battery.settings.max_percentage / 10), false);
|
||||
|
||||
// Update webserver datalayer
|
||||
//0x20A
|
||||
datalayer_extended.tesla.status_contactor = battery_contactor;
|
||||
//datalayer_extended.tesla.BMS_hvilFault = BMS_a036_SW_HvpHvilFault;
|
||||
datalayer_extended.tesla.hvil_status = battery_hvil_status;
|
||||
//0x20A
|
||||
datalayer_extended.tesla.packContNegativeState = battery_packContNegativeState;
|
||||
datalayer_extended.tesla.packContPositiveState = battery_packContPositiveState;
|
||||
datalayer_extended.tesla.packContactorSetState = battery_packContactorSetState;
|
||||
datalayer_extended.tesla.packCtrsClosingAllowed = battery_packCtrsClosingAllowed;
|
||||
datalayer_extended.tesla.packCtrsClosingBlocked = battery_packCtrsClosingBlocked;
|
||||
datalayer_extended.tesla.pyroTestInProgress = battery_pyroTestInProgress;
|
||||
datalayer_extended.tesla.battery_packCtrsOpenNowRequested = battery_packCtrsOpenNowRequested;
|
||||
datalayer_extended.tesla.battery_packCtrsOpenRequested = battery_packCtrsOpenRequested;
|
||||
|
@ -722,7 +751,7 @@ void TeslaBattery::
|
|||
//0x72A
|
||||
if (parsed_battery_serialNumber && battery_serialNumber[13] != 0) {
|
||||
memcpy(datalayer_extended.tesla.battery_serialNumber, battery_serialNumber, sizeof(battery_serialNumber));
|
||||
//datalayer_extended.tesla.battery_manufactureDate = battery_manufactureDate;
|
||||
datalayer_extended.tesla.battery_manufactureDate = battery_manufactureDate;
|
||||
//We have valid data and comms with the battery, attempt to query part number
|
||||
if (!parsed_battery_partNumber && stateMachineBMSQuery == 0xFF) {
|
||||
stateMachineBMSQuery = 0;
|
||||
|
@ -763,8 +792,8 @@ void TeslaBattery::
|
|||
datalayer_extended.tesla.battery_packMass = battery_packMass;
|
||||
datalayer_extended.tesla.battery_platformMaxBusVoltage = battery_platformMaxBusVoltage;
|
||||
//0x2D2
|
||||
datalayer_extended.tesla.battery_bms_min_voltage = battery_bms_min_voltage;
|
||||
datalayer_extended.tesla.battery_bms_max_voltage = battery_bms_max_voltage;
|
||||
datalayer_extended.tesla.BMS_min_voltage = BMS_min_voltage;
|
||||
datalayer_extended.tesla.BMS_max_voltage = BMS_max_voltage;
|
||||
datalayer_extended.tesla.battery_max_charge_current = battery_max_charge_current;
|
||||
datalayer_extended.tesla.battery_max_discharge_current = battery_max_discharge_current;
|
||||
//0x292
|
||||
|
@ -782,30 +811,30 @@ void TeslaBattery::
|
|||
datalayer_extended.tesla.battery_BrickModelTMax = battery_BrickModelTMax;
|
||||
datalayer_extended.tesla.battery_BrickModelTMin = battery_BrickModelTMin;
|
||||
//0x212
|
||||
datalayer_extended.tesla.battery_BMS_isolationResistance = battery_BMS_isolationResistance;
|
||||
datalayer_extended.tesla.battery_BMS_contactorState = battery_BMS_contactorState;
|
||||
datalayer_extended.tesla.battery_BMS_state = battery_BMS_state;
|
||||
datalayer_extended.tesla.battery_BMS_hvState = battery_BMS_hvState;
|
||||
datalayer_extended.tesla.battery_BMS_uiChargeStatus = battery_BMS_uiChargeStatus;
|
||||
datalayer_extended.tesla.battery_BMS_diLimpRequest = battery_BMS_diLimpRequest;
|
||||
datalayer_extended.tesla.battery_BMS_chgPowerAvailable = battery_BMS_chgPowerAvailable;
|
||||
datalayer_extended.tesla.battery_BMS_pcsPwmEnabled = battery_BMS_pcsPwmEnabled;
|
||||
datalayer_extended.tesla.BMS_isolationResistance = BMS_isolationResistance;
|
||||
datalayer_extended.tesla.BMS_contactorState = BMS_contactorState;
|
||||
datalayer_extended.tesla.BMS_state = BMS_state;
|
||||
datalayer_extended.tesla.BMS_hvState = BMS_hvState;
|
||||
datalayer_extended.tesla.BMS_uiChargeStatus = BMS_uiChargeStatus;
|
||||
datalayer_extended.tesla.BMS_diLimpRequest = BMS_diLimpRequest;
|
||||
datalayer_extended.tesla.BMS_chgPowerAvailable = BMS_chgPowerAvailable;
|
||||
datalayer_extended.tesla.BMS_pcsPwmEnabled = BMS_pcsPwmEnabled;
|
||||
//0x224
|
||||
datalayer_extended.tesla.battery_PCS_dcdcPrechargeStatus = battery_PCS_dcdcPrechargeStatus;
|
||||
datalayer_extended.tesla.battery_PCS_dcdc12VSupportStatus = battery_PCS_dcdc12VSupportStatus;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcHvBusDischargeStatus = battery_PCS_dcdcHvBusDischargeStatus;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcMainState = battery_PCS_dcdcMainState;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcSubState = battery_PCS_dcdcSubState;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcFaulted = battery_PCS_dcdcFaulted;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcOutputIsLimited = battery_PCS_dcdcOutputIsLimited;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcMaxOutputCurrentAllowed = battery_PCS_dcdcMaxOutputCurrentAllowed;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcPrechargeRtyCnt = battery_PCS_dcdcPrechargeRtyCnt;
|
||||
datalayer_extended.tesla.battery_PCS_dcdc12VSupportRtyCnt = battery_PCS_dcdc12VSupportRtyCnt;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcDischargeRtyCnt = battery_PCS_dcdcDischargeRtyCnt;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcPwmEnableLine = battery_PCS_dcdcPwmEnableLine;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcSupportingFixedLvTarget = battery_PCS_dcdcSupportingFixedLvTarget;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcPrechargeRestartCnt = battery_PCS_dcdcPrechargeRestartCnt;
|
||||
datalayer_extended.tesla.battery_PCS_dcdcInitialPrechargeSubState = battery_PCS_dcdcInitialPrechargeSubState;
|
||||
datalayer_extended.tesla.PCS_dcdcPrechargeStatus = PCS_dcdcPrechargeStatus;
|
||||
datalayer_extended.tesla.PCS_dcdc12VSupportStatus = PCS_dcdc12VSupportStatus;
|
||||
datalayer_extended.tesla.PCS_dcdcHvBusDischargeStatus = PCS_dcdcHvBusDischargeStatus;
|
||||
datalayer_extended.tesla.PCS_dcdcMainState = PCS_dcdcMainState;
|
||||
datalayer_extended.tesla.PCS_dcdcSubState = PCS_dcdcSubState;
|
||||
datalayer_extended.tesla.PCS_dcdcFaulted = PCS_dcdcFaulted;
|
||||
datalayer_extended.tesla.PCS_dcdcOutputIsLimited = PCS_dcdcOutputIsLimited;
|
||||
datalayer_extended.tesla.PCS_dcdcMaxOutputCurrentAllowed = PCS_dcdcMaxOutputCurrentAllowed;
|
||||
datalayer_extended.tesla.PCS_dcdcPrechargeRtyCnt = PCS_dcdcPrechargeRtyCnt;
|
||||
datalayer_extended.tesla.PCS_dcdc12VSupportRtyCnt = PCS_dcdc12VSupportRtyCnt;
|
||||
datalayer_extended.tesla.PCS_dcdcDischargeRtyCnt = PCS_dcdcDischargeRtyCnt;
|
||||
datalayer_extended.tesla.PCS_dcdcPwmEnableLine = PCS_dcdcPwmEnableLine;
|
||||
datalayer_extended.tesla.PCS_dcdcSupportingFixedLvTarget = PCS_dcdcSupportingFixedLvTarget;
|
||||
datalayer_extended.tesla.PCS_dcdcPrechargeRestartCnt = PCS_dcdcPrechargeRestartCnt;
|
||||
datalayer_extended.tesla.PCS_dcdcInitialPrechargeSubState = PCS_dcdcInitialPrechargeSubState;
|
||||
//0x252
|
||||
datalayer_extended.tesla.BMS_maxRegenPower = BMS_maxRegenPower;
|
||||
datalayer_extended.tesla.BMS_maxDischargePower = BMS_maxDischargePower;
|
||||
|
@ -814,6 +843,8 @@ void TeslaBattery::
|
|||
datalayer_extended.tesla.BMS_notEnoughPowerForHeatPump = BMS_notEnoughPowerForHeatPump;
|
||||
datalayer_extended.tesla.BMS_powerLimitState = BMS_powerLimitState;
|
||||
datalayer_extended.tesla.BMS_inverterTQF = BMS_inverterTQF;
|
||||
//Via UDS
|
||||
//datalayer_extended.tesla.BMS_info_buildConfigId = BMS_info_buildConfigId;
|
||||
//0x300
|
||||
datalayer_extended.tesla.BMS_info_buildConfigId = BMS_info_buildConfigId;
|
||||
datalayer_extended.tesla.BMS_info_hardwareId = BMS_info_hardwareId;
|
||||
|
@ -1033,7 +1064,7 @@ void TeslaBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
|
|||
mux0_read = true; //Set flag to true
|
||||
}
|
||||
if (mux == 1) {
|
||||
battery_fully_charged = (rx_frame.data.u8[1] & 0x01); //15|1@1+ (1,0) [0|1]//noYes
|
||||
battery_fully_charged = (rx_frame.data.u8[1] & 0x01); //BMS_fullChargeComplete : 15|1@1+ (1,0) [0|1]//noYes
|
||||
battery_energy_buffer_m1 =
|
||||
((rx_frame.data.u8[3] << 8) | rx_frame.data.u8[2]); //16|16@1+ (0.01,0) [0|0] "kWh"//to datalayer_extended
|
||||
battery_expected_energy_remaining_m1 =
|
||||
|
@ -1048,33 +1079,38 @@ void TeslaBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
|
|||
mux0_read = false;
|
||||
mux1_read = false;
|
||||
BMS352_mux = true; //Set flag to true
|
||||
break;
|
||||
}
|
||||
// older BMS <2021 without mux
|
||||
battery_nominal_full_pack_energy = //BMS_nominalFullPackEnergy : 0|11@1+ (0.1,0) [0|204.6] "KWh" //((_d[1] & (0x07U)) << 8) | (_d[0] & (0xFFU));
|
||||
if (mux0_read || mux1_read || BMS352_mux) {
|
||||
//Skip older BMS frame parsing
|
||||
break;
|
||||
}
|
||||
// Older BMS <2021 without mux
|
||||
battery_nominal_full_pack_energy = //BMS_nominalFullPackEnergy : 0|11@1+ (0.1,0) [0|204.6] "kWh" //((_d[1] & (0x07U)) << 8) | (_d[0] & (0xFFU));
|
||||
(((rx_frame.data.u8[1] & 0x07) << 8) | (rx_frame.data.u8[0])); //Example 752 (75.2kWh)
|
||||
battery_nominal_energy_remaining = //BMS_nominalEnergyRemaining : 11|11@1+ (0.1,0) [0|204.6] "KWh" //((_d[2] & (0x3FU)) << 5) | ((_d[1] >> 3) & (0x1FU));
|
||||
battery_nominal_energy_remaining = //BMS_nominalEnergyRemaining : 11|11@1+ (0.1,0) [0|204.6] "kWh" //((_d[2] & (0x3FU)) << 5) | ((_d[1] >> 3) & (0x1FU));
|
||||
(((rx_frame.data.u8[2] & 0x3F) << 5) | ((rx_frame.data.u8[1] & 0x1F) >> 3)); //Example 1247 * 0.1 = 124.7kWh
|
||||
battery_expected_energy_remaining = //BMS_expectedEnergyRemaining : 22|11@1+ (0.1,0) [0|204.6] "KWh"// ((_d[4] & (0x01U)) << 10) | ((_d[3] & (0xFFU)) << 2) | ((_d[2] >> 6) & (0x03U));
|
||||
battery_expected_energy_remaining = //BMS_expectedEnergyRemaining : 22|11@1+ (0.1,0) [0|204.6] "kWh"// ((_d[4] & (0x01U)) << 10) | ((_d[3] & (0xFFU)) << 2) | ((_d[2] >> 6) & (0x03U));
|
||||
(((rx_frame.data.u8[4] & 0x01) << 10) | (rx_frame.data.u8[3] << 2) |
|
||||
((rx_frame.data.u8[2] & 0x03) >> 6)); //Example 622 (62.2kWh)
|
||||
battery_ideal_energy_remaining = //BMS_idealEnergyRemaining : 33|11@1+ (0.1,0) [0|204.6] "KWh" //((_d[5] & (0x0FU)) << 7) | ((_d[4] >> 1) & (0x7FU));
|
||||
battery_ideal_energy_remaining = //BMS_idealEnergyRemaining : 33|11@1+ (0.1,0) [0|204.6] "kWh" //((_d[5] & (0x0FU)) << 7) | ((_d[4] >> 1) & (0x7FU));
|
||||
(((rx_frame.data.u8[5] & 0x0F) << 7) | ((rx_frame.data.u8[4] & 0x7F) >> 1)); //Example 311 * 0.1 = 31.1kWh
|
||||
battery_energy_to_charge_complete = // BMS_energyToChargeComplete : 44|11@1+ (0.1,0) [0|204.6] "KWh"// ((_d[6] & (0x7FU)) << 4) | ((_d[5] >> 4) & (0x0FU));
|
||||
battery_energy_to_charge_complete = // BMS_energyToChargeComplete : 44|11@1+ (0.1,0) [0|204.6] "kWh"// ((_d[6] & (0x7FU)) << 4) | ((_d[5] >> 4) & (0x0FU));
|
||||
(((rx_frame.data.u8[6] & 0x7F) << 4) | ((rx_frame.data.u8[5] & 0x0F) << 4)); //Example 147 * 0.1 = 14.7kWh
|
||||
battery_energy_buffer = //BMS_energyBuffer : 55|8@1+ (0.1,0) [0|25.4] "KWh"// ((_d[7] & (0x7FU)) << 1) | ((_d[6] >> 7) & (0x01U));
|
||||
battery_energy_buffer = //BMS_energyBuffer : 55|8@1+ (0.1,0) [0|25.4] "kWh"// ((_d[7] & (0x7FU)) << 1) | ((_d[6] >> 7) & (0x01U));
|
||||
(((rx_frame.data.u8[7] & 0xFE) >> 1) | ((rx_frame.data.u8[6] & 0x80) >> 7)); //Example 1 * 0.1 = 0
|
||||
battery_full_charge_complete = //BMS_fullChargeComplete : 63|1@1+ (1,0) [0|1] ""//((_d[7] >> 7) & (0x01U));
|
||||
battery_fully_charged = //BMS_fullChargeComplete : 63|1@1+ (1,0) [0|1] ""//((_d[7] >> 7) & (0x01U));
|
||||
((rx_frame.data.u8[7] >> 7) & 0x01); //noYes
|
||||
break;
|
||||
case 0x20A: //522 HVP_contactorState:
|
||||
battery_packContNegativeState =
|
||||
(rx_frame.data.u8[0] & 0x07); //(_d[0] & (0x07U)); 0|3@1+ (1,0) [0|7] //contactorState
|
||||
battery_packContPositiveState =
|
||||
(rx_frame.data.u8[0] & 0x38) >> 3; //((_d[0] >> 3) & (0x07U)); 3|3@1+ (1,0) [0|7] //contactorState
|
||||
battery_contactor = (rx_frame.data.u8[1] & 0x0F); // 8|4@1+ (1,0) [0|9] //contactorText
|
||||
(rx_frame.data.u8[0] & 0x38) >> 3; //((_d[0] >> 3) & (0x07U)); 3|3@1+ (1,0) [0|7] //contactorState
|
||||
//battery_contactor = (rx_frame.data.u8[1] & 0x0F); // 8|4@1+ (1,0) [0|9] //contactorText
|
||||
battery_packContactorSetState =
|
||||
(rx_frame.data.u8[1] & 0x0F); //(_d[1] & (0x0FU)); 8|4@1+ (1,0) [0|9] //contactorState
|
||||
battery_packCtrsClosingAllowed =
|
||||
battery_packCtrsClosingBlocked =
|
||||
(rx_frame.data.u8[4] & 0x08) >> 3; //((_d[4] >> 3) & (0x01U)); 35|1@1+ (1,0) [0|1] //noYes
|
||||
battery_pyroTestInProgress =
|
||||
(rx_frame.data.u8[4] & 0x20) >> 5; //((_d[4] >> 5) & (0x01U));//37|1@1+ (1,0) [0|1] //noYes
|
||||
|
@ -1096,66 +1132,69 @@ void TeslaBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
|
|||
battery_fcCtrsRequestStatus = (rx_frame.data.u8[3] & (0x03U)); //24|2@1+ (1,0) [0|2] "" Receiver
|
||||
battery_fcCtrsResetRequestRequired = ((rx_frame.data.u8[3] >> 2) & (0x01U)); //26|1@1+ (1,0) [0|1] "" Receiver
|
||||
battery_fcLinkAllowedToEnergize = ((rx_frame.data.u8[5] >> 4) & (0x03U)); //44|2@1+ (1,0) [0|2] "" Receiver
|
||||
break;
|
||||
case 0x212: //530 BMS_status: 8
|
||||
battery_BMS_hvacPowerRequest = (rx_frame.data.u8[0] & (0x01U));
|
||||
battery_BMS_notEnoughPowerForDrive = ((rx_frame.data.u8[0] >> 1) & (0x01U));
|
||||
battery_BMS_notEnoughPowerForSupport = ((rx_frame.data.u8[0] >> 2) & (0x01U));
|
||||
battery_BMS_preconditionAllowed = ((rx_frame.data.u8[0] >> 3) & (0x01U));
|
||||
battery_BMS_updateAllowed = ((rx_frame.data.u8[0] >> 4) & (0x01U));
|
||||
battery_BMS_activeHeatingWorthwhile = ((rx_frame.data.u8[0] >> 5) & (0x01U));
|
||||
battery_BMS_cpMiaOnHvs = ((rx_frame.data.u8[0] >> 6) & (0x01U));
|
||||
battery_BMS_contactorState =
|
||||
(rx_frame.data.u8[1] &
|
||||
(0x07U)); //0 "SNA" 1 "OPEN" 2 "OPENING" 3 "CLOSING" 4 "CLOSED" 5 "WELDED" 6 "BLOCKED" ;
|
||||
battery_BMS_state =
|
||||
((rx_frame.data.u8[1] >> 3) &
|
||||
(0x0FU)); //0 "STANDBY" 1 "DRIVE" 2 "SUPPORT" 3 "CHARGE" 4 "FEIM" 5 "CLEAR_FAULT" 6 "FAULT" 7 "WELD" 8 "TEST" 9 "SNA" ;
|
||||
battery_BMS_hvState =
|
||||
(rx_frame.data.u8[2] &
|
||||
(0x07U)); //0 "DOWN" 1 "COMING_UP" 2 "GOING_DOWN" 3 "UP_FOR_DRIVE" 4 "UP_FOR_CHARGE" 5 "UP_FOR_DC_CHARGE" 6 "UP" ;
|
||||
battery_BMS_isolationResistance =
|
||||
case 0x212: //530 BMS_status: 8
|
||||
BMS_hvacPowerRequest = (rx_frame.data.u8[0] & (0x01U));
|
||||
BMS_notEnoughPowerForDrive = ((rx_frame.data.u8[0] >> 1) & (0x01U));
|
||||
BMS_notEnoughPowerForSupport = ((rx_frame.data.u8[0] >> 2) & (0x01U));
|
||||
BMS_preconditionAllowed = ((rx_frame.data.u8[0] >> 3) & (0x01U));
|
||||
BMS_updateAllowed = ((rx_frame.data.u8[0] >> 4) & (0x01U));
|
||||
BMS_activeHeatingWorthwhile = ((rx_frame.data.u8[0] >> 5) & (0x01U));
|
||||
BMS_cpMiaOnHvs = ((rx_frame.data.u8[0] >> 6) & (0x01U));
|
||||
BMS_contactorState = (rx_frame.data.u8[1] &
|
||||
(0x07U)); //0 "SNA" 1 "OPEN" 2 "OPENING" 3 "CLOSING" 4 "CLOSED" 5 "WELDED" 6 "BLOCKED" ;
|
||||
battery_contactor = BMS_contactorState;
|
||||
//BMS_state = // Original code from older DBCs
|
||||
//((rx_frame.data.u8[1] >> 3) &
|
||||
//(0x0FU)); //0 "STANDBY" 1 "DRIVE" 2 "SUPPORT" 3 "CHARGE" 4 "FEIM" 5 "CLEAR_FAULT" 6 "FAULT" 7 "WELD" 8 "TEST" 9 "SNA" ;
|
||||
BMS_state = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 31, 4));
|
||||
//0 "STANDBY" 1 "DRIVE" 2 "SUPPORT" 3 "CHARGE" 4 "FEIM" 5 "CLEAR_FAULT" 6 "FAULT" 7 "WELD" 8 "TEST" 9 "SNA" 10 "BMS_DIAG";
|
||||
BMS_hvState = (rx_frame.data.u8[2] & (0x07U));
|
||||
//0 "DOWN" 1 "COMING_UP" 2 "GOING_DOWN" 3 "UP_FOR_DRIVE" 4 "UP_FOR_CHARGE" 5 "UP_FOR_DC_CHARGE" 6 "UP" ;
|
||||
BMS_isolationResistance =
|
||||
((rx_frame.data.u8[3] & (0x1FU)) << 5) |
|
||||
((rx_frame.data.u8[2] >> 3) & (0x1FU)); //19|10@1+ (10,0) [0|0] "kOhm"/to datalayer_extended
|
||||
battery_BMS_chargeRequest = ((rx_frame.data.u8[3] >> 5) & (0x01U));
|
||||
battery_BMS_keepWarmRequest = ((rx_frame.data.u8[3] >> 6) & (0x01U));
|
||||
battery_BMS_uiChargeStatus =
|
||||
(rx_frame.data.u8[4] &
|
||||
(0x07U)); // 0 "DISCONNECTED" 1 "NO_POWER" 2 "ABOUT_TO_CHARGE" 3 "CHARGING" 4 "CHARGE_COMPLETE" 5 "CHARGE_STOPPED" ;
|
||||
battery_BMS_diLimpRequest = ((rx_frame.data.u8[4] >> 3) & (0x01U));
|
||||
battery_BMS_okToShipByAir = ((rx_frame.data.u8[4] >> 4) & (0x01U));
|
||||
battery_BMS_okToShipByLand = ((rx_frame.data.u8[4] >> 5) & (0x01U));
|
||||
battery_BMS_chgPowerAvailable = ((rx_frame.data.u8[6] & (0x01U)) << 10) | ((rx_frame.data.u8[5] & (0xFFU)) << 2) |
|
||||
((rx_frame.data.u8[4] >> 6) & (0x03U)); //38|11@1+ (0.125,0) [0|0] "kW"
|
||||
battery_BMS_chargeRetryCount = ((rx_frame.data.u8[6] >> 1) & (0x0FU));
|
||||
battery_BMS_pcsPwmEnabled = ((rx_frame.data.u8[6] >> 5) & (0x01U));
|
||||
battery_BMS_ecuLogUploadRequest = ((rx_frame.data.u8[6] >> 6) & (0x03U));
|
||||
battery_BMS_minPackTemperature = (rx_frame.data.u8[7] & (0xFFU)); //56|8@1+ (0.5,-40) [0|0] "DegC
|
||||
//BMS_chargeRequest = ((rx_frame.data.u8[3] >> 5) & (0x01U));
|
||||
BMS_chargeRequest = static_cast<bool>(extract_signal_value(rx_frame.data.u8, 29, 1));
|
||||
BMS_keepWarmRequest = ((rx_frame.data.u8[3] >> 6) & (0x01U));
|
||||
BMS_uiChargeStatus = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 32, 3));
|
||||
//BMS_uiChargeStatus =
|
||||
//(rx_frame.data.u8[4] &
|
||||
//(0x07U));
|
||||
// 0 "DISCONNECTED" 1 "NO_POWER" 2 "ABOUT_TO_CHARGE" 3 "CHARGING" 4 "CHARGE_COMPLETE" 5 "CHARGE_STOPPED" ;
|
||||
BMS_diLimpRequest = ((rx_frame.data.u8[4] >> 3) & (0x01U));
|
||||
BMS_okToShipByAir = ((rx_frame.data.u8[4] >> 4) & (0x01U));
|
||||
BMS_okToShipByLand = ((rx_frame.data.u8[4] >> 5) & (0x01U));
|
||||
BMS_chgPowerAvailable = ((rx_frame.data.u8[6] & (0x01U)) << 10) | ((rx_frame.data.u8[5] & (0xFFU)) << 2) |
|
||||
((rx_frame.data.u8[4] >> 6) & (0x03U)); //38|11@1+ (0.125,0) [0|0] "kW"
|
||||
BMS_chargeRetryCount = ((rx_frame.data.u8[6] >> 1) & (0x0FU));
|
||||
BMS_pcsPwmEnabled = ((rx_frame.data.u8[6] >> 5) & (0x01U));
|
||||
BMS_ecuLogUploadRequest = ((rx_frame.data.u8[6] >> 6) & (0x03U));
|
||||
BMS_minPackTemperature = (rx_frame.data.u8[7] & (0xFFU)); //56|8@1+ (0.5,-40) [0|0] "DegC
|
||||
break;
|
||||
case 0x224: //548 PCS_dcdcStatus:
|
||||
battery_PCS_dcdcPrechargeStatus = (rx_frame.data.u8[0] & (0x03U)); //0 "IDLE" 1 "ACTIVE" 2 "FAULTED" ;
|
||||
battery_PCS_dcdc12VSupportStatus = ((rx_frame.data.u8[0] >> 2) & (0x03U)); //0 "IDLE" 1 "ACTIVE" 2 "FAULTED"
|
||||
battery_PCS_dcdcHvBusDischargeStatus = ((rx_frame.data.u8[0] >> 4) & (0x03U)); //0 "IDLE" 1 "ACTIVE" 2 "FAULTED"
|
||||
battery_PCS_dcdcMainState =
|
||||
case 0x224: //548 PCS_dcdcStatus:
|
||||
PCS_dcdcPrechargeStatus = (rx_frame.data.u8[0] & (0x03U)); //0 "IDLE" 1 "ACTIVE" 2 "FAULTED" ;
|
||||
PCS_dcdc12VSupportStatus = ((rx_frame.data.u8[0] >> 2) & (0x03U)); //0 "IDLE" 1 "ACTIVE" 2 "FAULTED"
|
||||
PCS_dcdcHvBusDischargeStatus = ((rx_frame.data.u8[0] >> 4) & (0x03U)); //0 "IDLE" 1 "ACTIVE" 2 "FAULTED"
|
||||
PCS_dcdcMainState =
|
||||
((rx_frame.data.u8[1] & (0x03U)) << 2) |
|
||||
((rx_frame.data.u8[0] >> 6) &
|
||||
(0x03U)); //0 "STANDBY" 1 "12V_SUPPORT_ACTIVE" 2 "PRECHARGE_STARTUP" 3 "PRECHARGE_ACTIVE" 4 "DIS_HVBUS_ACTIVE" 5 "SHUTDOWN" 6 "FAULTED" ;
|
||||
battery_PCS_dcdcSubState =
|
||||
PCS_dcdcSubState =
|
||||
((rx_frame.data.u8[1] >> 2) &
|
||||
(0x1FU)); //0 "PWR_UP_INIT" 1 "STANDBY" 2 "12V_SUPPORT_ACTIVE" 3 "DIS_HVBUS" 4 "PCHG_FAST_DIS_HVBUS" 5 "PCHG_SLOW_DIS_HVBUS" 6 "PCHG_DWELL_CHARGE" 7 "PCHG_DWELL_WAIT" 8 "PCHG_DI_RECOVERY_WAIT" 9 "PCHG_ACTIVE" 10 "PCHG_FLT_FAST_DIS_HVBUS" 11 "SHUTDOWN" 12 "12V_SUPPORT_FAULTED" 13 "DIS_HVBUS_FAULTED" 14 "PCHG_FAULTED" 15 "CLEAR_FAULTS" 16 "FAULTED" 17 "NUM" ;
|
||||
battery_PCS_dcdcFaulted = ((rx_frame.data.u8[1] >> 7) & (0x01U));
|
||||
battery_PCS_dcdcOutputIsLimited = ((rx_frame.data.u8[3] >> 4) & (0x01U));
|
||||
battery_PCS_dcdcMaxOutputCurrentAllowed = ((rx_frame.data.u8[5] & (0x01U)) << 11) |
|
||||
((rx_frame.data.u8[4] & (0xFFU)) << 3) |
|
||||
((rx_frame.data.u8[3] >> 5) & (0x07U)); //29|12@1+ (0.1,0) [0|0] "A"
|
||||
battery_PCS_dcdcPrechargeRtyCnt = ((rx_frame.data.u8[5] >> 1) & (0x07U)); //Retry Count
|
||||
battery_PCS_dcdc12VSupportRtyCnt = ((rx_frame.data.u8[5] >> 4) & (0x0FU)); //Retry Count
|
||||
battery_PCS_dcdcDischargeRtyCnt = (rx_frame.data.u8[6] & (0x0FU)); //Retry Count
|
||||
battery_PCS_dcdcPwmEnableLine = ((rx_frame.data.u8[6] >> 4) & (0x01U));
|
||||
battery_PCS_dcdcSupportingFixedLvTarget = ((rx_frame.data.u8[6] >> 5) & (0x01U));
|
||||
battery_PCS_ecuLogUploadRequest = ((rx_frame.data.u8[6] >> 6) & (0x03U));
|
||||
battery_PCS_dcdcPrechargeRestartCnt = (rx_frame.data.u8[7] & (0x07U));
|
||||
battery_PCS_dcdcInitialPrechargeSubState =
|
||||
PCS_dcdcFaulted = ((rx_frame.data.u8[1] >> 7) & (0x01U));
|
||||
PCS_dcdcOutputIsLimited = ((rx_frame.data.u8[3] >> 4) & (0x01U));
|
||||
PCS_dcdcMaxOutputCurrentAllowed = ((rx_frame.data.u8[5] & (0x01U)) << 11) |
|
||||
((rx_frame.data.u8[4] & (0xFFU)) << 3) |
|
||||
((rx_frame.data.u8[3] >> 5) & (0x07U)); //29|12@1+ (0.1,0) [0|0] "A"
|
||||
PCS_dcdcPrechargeRtyCnt = ((rx_frame.data.u8[5] >> 1) & (0x07U)); //Retry Count
|
||||
PCS_dcdc12VSupportRtyCnt = ((rx_frame.data.u8[5] >> 4) & (0x0FU)); //Retry Count
|
||||
PCS_dcdcDischargeRtyCnt = (rx_frame.data.u8[6] & (0x0FU)); //Retry Count
|
||||
PCS_dcdcPwmEnableLine = ((rx_frame.data.u8[6] >> 4) & (0x01U));
|
||||
PCS_dcdcSupportingFixedLvTarget = ((rx_frame.data.u8[6] >> 5) & (0x01U));
|
||||
PCS_ecuLogUploadRequest = ((rx_frame.data.u8[6] >> 6) & (0x03U));
|
||||
PCS_dcdcPrechargeRestartCnt = (rx_frame.data.u8[7] & (0x07U));
|
||||
PCS_dcdcInitialPrechargeSubState =
|
||||
((rx_frame.data.u8[7] >> 3) &
|
||||
(0x1FU)); //0 "PWR_UP_INIT" 1 "STANDBY" 2 "12V_SUPPORT_ACTIVE" 3 "DIS_HVBUS" 4 "PCHG_FAST_DIS_HVBUS" 5 "PCHG_SLOW_DIS_HVBUS" 6 "PCHG_DWELL_CHARGE" 7 "PCHG_DWELL_WAIT" 8 "PCHG_DI_RECOVERY_WAIT" 9 "PCHG_ACTIVE" 10 "PCHG_FLT_FAST_DIS_HVBUS" 11 "SHUTDOWN" 12 "12V_SUPPORT_FAULTED" 13 "DIS_HVBUS_FAULTED" 14 "PCHG_FAULTED" 15 "CLEAR_FAULTS" 16 "FAULTED" 17 "NUM" ;
|
||||
break;
|
||||
|
@ -1364,12 +1403,10 @@ void TeslaBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
|
|||
}
|
||||
break;
|
||||
case 0x2d2: //BMSVAlimits:
|
||||
battery_bms_min_voltage =
|
||||
((rx_frame.data.u8[1] << 8) |
|
||||
rx_frame.data.u8[0]); //0|16@1+ (0.01,0) [0|430] "V" //Example 24148mv * 0.01 = 241.48 V
|
||||
battery_bms_max_voltage =
|
||||
((rx_frame.data.u8[3] << 8) |
|
||||
rx_frame.data.u8[2]); //16|16@1+ (0.01,0) [0|430] "V" //Example 40282mv * 0.01 = 402.82 V
|
||||
BMS_min_voltage = ((rx_frame.data.u8[1] << 8) |
|
||||
rx_frame.data.u8[0]); //0|16@1+ (0.01,0) [0|430] "V" //Example 24148mv * 0.01 = 241.48 V
|
||||
BMS_max_voltage = ((rx_frame.data.u8[3] << 8) |
|
||||
rx_frame.data.u8[2]); //16|16@1+ (0.01,0) [0|430] "V" //Example 40282mv * 0.01 = 402.82 V
|
||||
battery_max_charge_current = (((rx_frame.data.u8[5] & 0x3F) << 8) | rx_frame.data.u8[4]) *
|
||||
0.1; //32|14@1+ (0.1,0) [0|1638.2] "A" //Example 1301? * 0.1 = 130.1?
|
||||
battery_max_discharge_current = (((rx_frame.data.u8[7] & 0x3F) << 8) | rx_frame.data.u8[6]) *
|
||||
|
@ -1511,6 +1548,7 @@ void TeslaBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
|
|||
HVP_shuntAsicTempStatus = ((rx_frame.data.u8[7] >> 4) & (0x03U)); //: 60|2@1+ (1,0) [0|3] "" Receiver
|
||||
}
|
||||
break;
|
||||
/* We ignore 0x3AA for now, as on later software/firmware this is a muxed frame so values aren't correct
|
||||
case 0x3aa: //HVP_alertMatrix1
|
||||
battery_WatchdogReset = (rx_frame.data.u8[0] & 0x01);
|
||||
battery_PowerLossReset = ((rx_frame.data.u8[0] & 0x02) >> 1);
|
||||
|
@ -1563,107 +1601,107 @@ void TeslaBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
|
|||
battery_packCtrCloseFailed = (rx_frame.data.u8[6] & 0x01);
|
||||
battery_fcCtrCloseFailed = ((rx_frame.data.u8[6] & 0x02) >> 1);
|
||||
battery_shuntThermistorMia = ((rx_frame.data.u8[6] & 0x04) >> 2);
|
||||
break;
|
||||
break;*/
|
||||
case 0x320: //800 BMS_alertMatrix //BMS_alertMatrix 800 BMS_alertMatrix: 8 VEH
|
||||
mux = (rx_frame.data.u8[0] & (0x0F));
|
||||
if (mux == 0) { //mux0
|
||||
battery_BMS_matrixIndex = (rx_frame.data.u8[0] & (0x0F)); // 0|4@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a017_SW_Brick_OV = ((rx_frame.data.u8[2] >> 4) & (0x01)); //20|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a018_SW_Brick_UV = ((rx_frame.data.u8[2] >> 5) & (0x01)); //21|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a019_SW_Module_OT = ((rx_frame.data.u8[2] >> 6) & (0x01)); //22|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a021_SW_Dr_Limits_Regulation = (rx_frame.data.u8[3] & (0x01U)); //24|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a022_SW_Over_Current = ((rx_frame.data.u8[3] >> 1) & (0x01U)); //25|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a023_SW_Stack_OV = ((rx_frame.data.u8[3] >> 2) & (0x01U)); //26|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a024_SW_Islanded_Brick = ((rx_frame.data.u8[3] >> 3) & (0x01U)); //27|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a025_SW_PwrBalance_Anomaly = ((rx_frame.data.u8[3] >> 4) & (0x01U)); //28|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a026_SW_HFCurrent_Anomaly = ((rx_frame.data.u8[3] >> 5) & (0x01U)); //29|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a034_SW_Passive_Isolation = ((rx_frame.data.u8[4] >> 5) & (0x01U)); //37|1@1+ (1,0) [0|0] "" X ?
|
||||
battery_BMS_a035_SW_Isolation = ((rx_frame.data.u8[4] >> 6) & (0x01U)); //38|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a036_SW_HvpHvilFault = ((rx_frame.data.u8[4] >> 6) & (0x01U)); //39|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a037_SW_Flood_Port_Open = (rx_frame.data.u8[5] & (0x01U)); //40|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a039_SW_DC_Link_Over_Voltage = ((rx_frame.data.u8[5] >> 2) & (0x01U)); //42|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a041_SW_Power_On_Reset = ((rx_frame.data.u8[5] >> 4) & (0x01U)); //44|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a042_SW_MPU_Error = ((rx_frame.data.u8[5] >> 5) & (0x01U)); //45|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a043_SW_Watch_Dog_Reset = ((rx_frame.data.u8[5] >> 6) & (0x01U)); //46|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a044_SW_Assertion = ((rx_frame.data.u8[5] >> 7) & (0x01U)); //47|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a045_SW_Exception = (rx_frame.data.u8[6] & (0x01U)); //48|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a046_SW_Task_Stack_Usage = ((rx_frame.data.u8[6] >> 1) & (0x01U)); //49|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a047_SW_Task_Stack_Overflow = ((rx_frame.data.u8[6] >> 2) & (0x01U)); //50|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a048_SW_Log_Upload_Request = ((rx_frame.data.u8[6] >> 3) & (0x01U)); //51|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a050_SW_Brick_Voltage_MIA = ((rx_frame.data.u8[6] >> 5) & (0x01U)); //53|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a051_SW_HVC_Vref_Bad = ((rx_frame.data.u8[6] >> 6) & (0x01U)); //54|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a052_SW_PCS_MIA = ((rx_frame.data.u8[6] >> 7) & (0x01U)); //55|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a053_SW_ThermalModel_Sanity = (rx_frame.data.u8[7] & (0x01U)); //56|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a054_SW_Ver_Supply_Fault = ((rx_frame.data.u8[7] >> 1) & (0x01U)); //57|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a059_SW_Pack_Voltage_Sensing = ((rx_frame.data.u8[7] >> 6) & (0x01U)); //62|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a060_SW_Leakage_Test_Failure = ((rx_frame.data.u8[7] >> 7) & (0x01U)); //63|1@1+ (1,0) [0|0] "" X
|
||||
if (mux == 0) { //mux0
|
||||
BMS_matrixIndex = (rx_frame.data.u8[0] & (0x0F)); // 0|4@1+ (1,0) [0|0] "" X
|
||||
BMS_a017_SW_Brick_OV = ((rx_frame.data.u8[2] >> 4) & (0x01)); //20|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a018_SW_Brick_UV = ((rx_frame.data.u8[2] >> 5) & (0x01)); //21|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a019_SW_Module_OT = ((rx_frame.data.u8[2] >> 6) & (0x01)); //22|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a021_SW_Dr_Limits_Regulation = (rx_frame.data.u8[3] & (0x01U)); //24|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a022_SW_Over_Current = ((rx_frame.data.u8[3] >> 1) & (0x01U)); //25|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a023_SW_Stack_OV = ((rx_frame.data.u8[3] >> 2) & (0x01U)); //26|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a024_SW_Islanded_Brick = ((rx_frame.data.u8[3] >> 3) & (0x01U)); //27|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a025_SW_PwrBalance_Anomaly = ((rx_frame.data.u8[3] >> 4) & (0x01U)); //28|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a026_SW_HFCurrent_Anomaly = ((rx_frame.data.u8[3] >> 5) & (0x01U)); //29|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a034_SW_Passive_Isolation = ((rx_frame.data.u8[4] >> 5) & (0x01U)); //37|1@1+ (1,0) [0|0] "" X ?
|
||||
BMS_a035_SW_Isolation = ((rx_frame.data.u8[4] >> 6) & (0x01U)); //38|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a036_SW_HvpHvilFault = ((rx_frame.data.u8[4] >> 6) & (0x01U)); //39|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a037_SW_Flood_Port_Open = (rx_frame.data.u8[5] & (0x01U)); //40|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a039_SW_DC_Link_Over_Voltage = ((rx_frame.data.u8[5] >> 2) & (0x01U)); //42|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a041_SW_Power_On_Reset = ((rx_frame.data.u8[5] >> 4) & (0x01U)); //44|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a042_SW_MPU_Error = ((rx_frame.data.u8[5] >> 5) & (0x01U)); //45|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a043_SW_Watch_Dog_Reset = ((rx_frame.data.u8[5] >> 6) & (0x01U)); //46|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a044_SW_Assertion = ((rx_frame.data.u8[5] >> 7) & (0x01U)); //47|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a045_SW_Exception = (rx_frame.data.u8[6] & (0x01U)); //48|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a046_SW_Task_Stack_Usage = ((rx_frame.data.u8[6] >> 1) & (0x01U)); //49|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a047_SW_Task_Stack_Overflow = ((rx_frame.data.u8[6] >> 2) & (0x01U)); //50|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a048_SW_Log_Upload_Request = ((rx_frame.data.u8[6] >> 3) & (0x01U)); //51|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a050_SW_Brick_Voltage_MIA = ((rx_frame.data.u8[6] >> 5) & (0x01U)); //53|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a051_SW_HVC_Vref_Bad = ((rx_frame.data.u8[6] >> 6) & (0x01U)); //54|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a052_SW_PCS_MIA = ((rx_frame.data.u8[6] >> 7) & (0x01U)); //55|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a053_SW_ThermalModel_Sanity = (rx_frame.data.u8[7] & (0x01U)); //56|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a054_SW_Ver_Supply_Fault = ((rx_frame.data.u8[7] >> 1) & (0x01U)); //57|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a059_SW_Pack_Voltage_Sensing = ((rx_frame.data.u8[7] >> 6) & (0x01U)); //62|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a060_SW_Leakage_Test_Failure = ((rx_frame.data.u8[7] >> 7) & (0x01U)); //63|1@1+ (1,0) [0|0] "" X
|
||||
}
|
||||
if (mux == 1) { //mux1
|
||||
battery_BMS_a061_robinBrickOverVoltage = ((rx_frame.data.u8[0] >> 4) & (0x01U)); //4|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a062_SW_BrickV_Imbalance = ((rx_frame.data.u8[0] >> 5) & (0x01U)); //5|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a063_SW_ChargePort_Fault = ((rx_frame.data.u8[0] >> 6) & (0x01U)); //6|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a064_SW_SOC_Imbalance = ((rx_frame.data.u8[0] >> 7) & (0x01U)); //7|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a069_SW_Low_Power = ((rx_frame.data.u8[1] >> 4) & (0x01U)); //12|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a071_SW_SM_TransCon_Not_Met = ((rx_frame.data.u8[1] >> 6) & (0x01U)); //14|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a075_SW_Chg_Disable_Failure = ((rx_frame.data.u8[2] >> 2) & (0x01U)); //18|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a076_SW_Dch_While_Charging = ((rx_frame.data.u8[2] >> 3) & (0x01U)); //19|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a077_SW_Charger_Regulation = ((rx_frame.data.u8[2] >> 4) & (0x01U)); //20|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a081_SW_Ctr_Close_Blocked = (rx_frame.data.u8[3] & (0x01U)); //24|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a082_SW_Ctr_Force_Open = ((rx_frame.data.u8[3] >> 1) & (0x01U)); //25|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a083_SW_Ctr_Close_Failure = ((rx_frame.data.u8[3] >> 2) & (0x01U)); //26|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a084_SW_Sleep_Wake_Aborted = ((rx_frame.data.u8[3] >> 3) & (0x01U)); //27|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a087_SW_Feim_Test_Blocked = ((rx_frame.data.u8[3] >> 6) & (0x01U)); //30|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a088_SW_VcFront_MIA_InDrive = ((rx_frame.data.u8[3] >> 7) & (0x01U)); //31|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a089_SW_VcFront_MIA = (rx_frame.data.u8[4] & (0x01U)); //32|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a090_SW_Gateway_MIA = ((rx_frame.data.u8[4] >> 1) & (0x01U)); //33|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a091_SW_ChargePort_MIA = ((rx_frame.data.u8[4] >> 2) & (0x01U)); //34|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a092_SW_ChargePort_Mia_On_Hv = ((rx_frame.data.u8[4] >> 3) & (0x01U)); //35|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a094_SW_Drive_Inverter_MIA = ((rx_frame.data.u8[4] >> 5) & (0x01U)); //37|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a099_SW_BMB_Communication = ((rx_frame.data.u8[5] >> 2) & (0x01U)); //42|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a105_SW_One_Module_Tsense = (rx_frame.data.u8[6] & (0x01U)); //48|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a106_SW_All_Module_Tsense = ((rx_frame.data.u8[6] >> 1) & (0x01U)); //49|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a107_SW_Stack_Voltage_MIA = ((rx_frame.data.u8[6] >> 2) & (0x01U)); //50|1@1+ (1,0) [0|0] "" X
|
||||
if (mux == 1) { //mux1
|
||||
BMS_a061_robinBrickOverVoltage = ((rx_frame.data.u8[0] >> 4) & (0x01U)); //4|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a062_SW_BrickV_Imbalance = ((rx_frame.data.u8[0] >> 5) & (0x01U)); //5|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a063_SW_ChargePort_Fault = ((rx_frame.data.u8[0] >> 6) & (0x01U)); //6|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a064_SW_SOC_Imbalance = ((rx_frame.data.u8[0] >> 7) & (0x01U)); //7|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a069_SW_Low_Power = ((rx_frame.data.u8[1] >> 4) & (0x01U)); //12|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a071_SW_SM_TransCon_Not_Met = ((rx_frame.data.u8[1] >> 6) & (0x01U)); //14|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a075_SW_Chg_Disable_Failure = ((rx_frame.data.u8[2] >> 2) & (0x01U)); //18|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a076_SW_Dch_While_Charging = ((rx_frame.data.u8[2] >> 3) & (0x01U)); //19|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a077_SW_Charger_Regulation = ((rx_frame.data.u8[2] >> 4) & (0x01U)); //20|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a081_SW_Ctr_Close_Blocked = (rx_frame.data.u8[3] & (0x01U)); //24|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a082_SW_Ctr_Force_Open = ((rx_frame.data.u8[3] >> 1) & (0x01U)); //25|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a083_SW_Ctr_Close_Failure = ((rx_frame.data.u8[3] >> 2) & (0x01U)); //26|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a084_SW_Sleep_Wake_Aborted = ((rx_frame.data.u8[3] >> 3) & (0x01U)); //27|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a087_SW_Feim_Test_Blocked = ((rx_frame.data.u8[3] >> 6) & (0x01U)); //30|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a088_SW_VcFront_MIA_InDrive = ((rx_frame.data.u8[3] >> 7) & (0x01U)); //31|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a089_SW_VcFront_MIA = (rx_frame.data.u8[4] & (0x01U)); //32|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a090_SW_Gateway_MIA = ((rx_frame.data.u8[4] >> 1) & (0x01U)); //33|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a091_SW_ChargePort_MIA = ((rx_frame.data.u8[4] >> 2) & (0x01U)); //34|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a092_SW_ChargePort_Mia_On_Hv = ((rx_frame.data.u8[4] >> 3) & (0x01U)); //35|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a094_SW_Drive_Inverter_MIA = ((rx_frame.data.u8[4] >> 5) & (0x01U)); //37|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a099_SW_BMB_Communication = ((rx_frame.data.u8[5] >> 2) & (0x01U)); //42|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a105_SW_One_Module_Tsense = (rx_frame.data.u8[6] & (0x01U)); //48|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a106_SW_All_Module_Tsense = ((rx_frame.data.u8[6] >> 1) & (0x01U)); //49|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a107_SW_Stack_Voltage_MIA = ((rx_frame.data.u8[6] >> 2) & (0x01U)); //50|1@1+ (1,0) [0|0] "" X
|
||||
}
|
||||
if (mux == 2) { //mux2
|
||||
battery_BMS_a121_SW_NVRAM_Config_Error = ((rx_frame.data.u8[0] >> 4) & (0x01U)); // 4|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a122_SW_BMS_Therm_Irrational = ((rx_frame.data.u8[0] >> 5) & (0x01U)); //5|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a123_SW_Internal_Isolation = ((rx_frame.data.u8[0] >> 6) & (0x01U)); //6|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a127_SW_shunt_SNA = ((rx_frame.data.u8[1] >> 2) & (0x01U)); //10|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a128_SW_shunt_MIA = ((rx_frame.data.u8[1] >> 3) & (0x01U)); //11|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a129_SW_VSH_Failure = ((rx_frame.data.u8[1] >> 4) & (0x01U)); //12|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a130_IO_CAN_Error = ((rx_frame.data.u8[1] >> 5) & (0x01U)); //13|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a131_Bleed_FET_Failure = ((rx_frame.data.u8[1] >> 6) & (0x01U)); //14|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a132_HW_BMB_OTP_Uncorrctbl = ((rx_frame.data.u8[1] >> 7) & (0x01U)); //15|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a134_SW_Delayed_Ctr_Off = ((rx_frame.data.u8[2] >> 1) & (0x01U)); //17|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a136_SW_Module_OT_Warning = ((rx_frame.data.u8[2] >> 3) & (0x01U)); //19|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a137_SW_Brick_UV_Warning = ((rx_frame.data.u8[2] >> 4) & (0x01U)); //20|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a138_SW_Brick_OV_Warning = ((rx_frame.data.u8[2] >> 5) & (0x01U)); //21|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a139_SW_DC_Link_V_Irrational = ((rx_frame.data.u8[2] >> 6) & (0x01U)); //22|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a141_SW_BMB_Status_Warning = (rx_frame.data.u8[3] & (0x01U)); //24|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a144_Hvp_Config_Mismatch = ((rx_frame.data.u8[3] >> 3) & (0x01U)); //27|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a145_SW_SOC_Change = ((rx_frame.data.u8[3] >> 4) & (0x01U)); //28|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a146_SW_Brick_Overdischarged = ((rx_frame.data.u8[3] >> 5) & (0x01U)); //29|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a149_SW_Missing_Config_Block = (rx_frame.data.u8[4] & (0x01U)); //32|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a151_SW_external_isolation = ((rx_frame.data.u8[4] >> 2) & (0x01U)); //34|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a156_SW_BMB_Vref_bad = ((rx_frame.data.u8[4] >> 7) & (0x01U)); //39|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a157_SW_HVP_HVS_Comms = (rx_frame.data.u8[5] & (0x01U)); //40|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a158_SW_HVP_HVI_Comms = ((rx_frame.data.u8[5] >> 1) & (0x01U)); //41|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a159_SW_HVP_ECU_Error = ((rx_frame.data.u8[5] >> 2) & (0x01U)); //42|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a161_SW_DI_Open_Request = ((rx_frame.data.u8[5] >> 4) & (0x01U)); //44|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a162_SW_No_Power_For_Support = ((rx_frame.data.u8[5] >> 5) & (0x01U)); //45|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a163_SW_Contactor_Mismatch = ((rx_frame.data.u8[5] >> 6) & (0x01U)); //46|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a164_SW_Uncontrolled_Regen = ((rx_frame.data.u8[5] >> 7) & (0x01U)); //47|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a165_SW_Pack_Partial_Weld = (rx_frame.data.u8[6] & (0x01U)); //48|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a166_SW_Pack_Full_Weld = ((rx_frame.data.u8[6] >> 1) & (0x01U)); //49|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a167_SW_FC_Partial_Weld = ((rx_frame.data.u8[6] >> 2) & (0x01U)); //50|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a168_SW_FC_Full_Weld = ((rx_frame.data.u8[6] >> 3) & (0x01U)); //51|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a169_SW_FC_Pack_Weld = ((rx_frame.data.u8[6] >> 4) & (0x01U)); //52|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a170_SW_Limp_Mode = ((rx_frame.data.u8[6] >> 5) & (0x01U)); //53|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a171_SW_Stack_Voltage_Sense = ((rx_frame.data.u8[6] >> 6) & (0x01U)); //54|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a174_SW_Charge_Failure = ((rx_frame.data.u8[7] >> 1) & (0x01U)); //57|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a176_SW_GracefulPowerOff = ((rx_frame.data.u8[7] >> 3) & (0x01U)); //59|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a179_SW_Hvp_12V_Fault = ((rx_frame.data.u8[7] >> 6) & (0x01U)); //62|1@1+ (1,0) [0|0] "" X
|
||||
battery_BMS_a180_SW_ECU_reset_blocked = ((rx_frame.data.u8[7] >> 7) & (0x01U)); //63|1@1+ (1,0) [0|0] "" X
|
||||
if (mux == 2) { //mux2
|
||||
BMS_a121_SW_NVRAM_Config_Error = ((rx_frame.data.u8[0] >> 4) & (0x01U)); // 4|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a122_SW_BMS_Therm_Irrational = ((rx_frame.data.u8[0] >> 5) & (0x01U)); //5|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a123_SW_Internal_Isolation = ((rx_frame.data.u8[0] >> 6) & (0x01U)); //6|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a127_SW_shunt_SNA = ((rx_frame.data.u8[1] >> 2) & (0x01U)); //10|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a128_SW_shunt_MIA = ((rx_frame.data.u8[1] >> 3) & (0x01U)); //11|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a129_SW_VSH_Failure = ((rx_frame.data.u8[1] >> 4) & (0x01U)); //12|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a130_IO_CAN_Error = ((rx_frame.data.u8[1] >> 5) & (0x01U)); //13|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a131_Bleed_FET_Failure = ((rx_frame.data.u8[1] >> 6) & (0x01U)); //14|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a132_HW_BMB_OTP_Uncorrctbl = ((rx_frame.data.u8[1] >> 7) & (0x01U)); //15|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a134_SW_Delayed_Ctr_Off = ((rx_frame.data.u8[2] >> 1) & (0x01U)); //17|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a136_SW_Module_OT_Warning = ((rx_frame.data.u8[2] >> 3) & (0x01U)); //19|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a137_SW_Brick_UV_Warning = ((rx_frame.data.u8[2] >> 4) & (0x01U)); //20|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a138_SW_Brick_OV_Warning = ((rx_frame.data.u8[2] >> 5) & (0x01U)); //21|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a139_SW_DC_Link_V_Irrational = ((rx_frame.data.u8[2] >> 6) & (0x01U)); //22|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a141_SW_BMB_Status_Warning = (rx_frame.data.u8[3] & (0x01U)); //24|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a144_Hvp_Config_Mismatch = ((rx_frame.data.u8[3] >> 3) & (0x01U)); //27|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a145_SW_SOC_Change = ((rx_frame.data.u8[3] >> 4) & (0x01U)); //28|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a146_SW_Brick_Overdischarged = ((rx_frame.data.u8[3] >> 5) & (0x01U)); //29|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a149_SW_Missing_Config_Block = (rx_frame.data.u8[4] & (0x01U)); //32|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a151_SW_external_isolation = ((rx_frame.data.u8[4] >> 2) & (0x01U)); //34|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a156_SW_BMB_Vref_bad = ((rx_frame.data.u8[4] >> 7) & (0x01U)); //39|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a157_SW_HVP_HVS_Comms = (rx_frame.data.u8[5] & (0x01U)); //40|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a158_SW_HVP_HVI_Comms = ((rx_frame.data.u8[5] >> 1) & (0x01U)); //41|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a159_SW_HVP_ECU_Error = ((rx_frame.data.u8[5] >> 2) & (0x01U)); //42|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a161_SW_DI_Open_Request = ((rx_frame.data.u8[5] >> 4) & (0x01U)); //44|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a162_SW_No_Power_For_Support = ((rx_frame.data.u8[5] >> 5) & (0x01U)); //45|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a163_SW_Contactor_Mismatch = ((rx_frame.data.u8[5] >> 6) & (0x01U)); //46|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a164_SW_Uncontrolled_Regen = ((rx_frame.data.u8[5] >> 7) & (0x01U)); //47|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a165_SW_Pack_Partial_Weld = (rx_frame.data.u8[6] & (0x01U)); //48|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a166_SW_Pack_Full_Weld = ((rx_frame.data.u8[6] >> 1) & (0x01U)); //49|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a167_SW_FC_Partial_Weld = ((rx_frame.data.u8[6] >> 2) & (0x01U)); //50|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a168_SW_FC_Full_Weld = ((rx_frame.data.u8[6] >> 3) & (0x01U)); //51|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a169_SW_FC_Pack_Weld = ((rx_frame.data.u8[6] >> 4) & (0x01U)); //52|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a170_SW_Limp_Mode = ((rx_frame.data.u8[6] >> 5) & (0x01U)); //53|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a171_SW_Stack_Voltage_Sense = ((rx_frame.data.u8[6] >> 6) & (0x01U)); //54|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a174_SW_Charge_Failure = ((rx_frame.data.u8[7] >> 1) & (0x01U)); //57|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a176_SW_GracefulPowerOff = ((rx_frame.data.u8[7] >> 3) & (0x01U)); //59|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a179_SW_Hvp_12V_Fault = ((rx_frame.data.u8[7] >> 6) & (0x01U)); //62|1@1+ (1,0) [0|0] "" X
|
||||
BMS_a180_SW_ECU_reset_blocked = ((rx_frame.data.u8[7] >> 7) & (0x01U)); //63|1@1+ (1,0) [0|0] "" X
|
||||
}
|
||||
break;
|
||||
case 0x72A: //BMS_serialNumber
|
||||
|
@ -1701,14 +1739,196 @@ void TeslaBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
|
|||
parsed_battery_serialNumber = true;
|
||||
}
|
||||
break;
|
||||
case 0x612: // CAN UDS responses for BMS ECU reset
|
||||
if (memcmp(rx_frame.data.u8, "\x02\x67\x06\xAA\xAA\xAA\xAA\xAA", 8) == 0) {
|
||||
logging.println("CAN UDS response: ECU unlocked");
|
||||
} else if (memcmp(rx_frame.data.u8, "\x03\x7F\x11\x78\xAA\xAA\xAA\xAA", 8) == 0) {
|
||||
logging.println("CAN UDS response: ECU reset request successful but ECU busy, response pending");
|
||||
} else if (memcmp(rx_frame.data.u8, "\x02\x51\x01\xAA\xAA\xAA\xAA\xAA", 8) == 0) {
|
||||
logging.println("CAN UDS response: ECU reset positive response, 1 second downtime");
|
||||
case 0x300: //BMS_info
|
||||
//Display internal BMS info and other build/version data
|
||||
if (rx_frame.data.u8[0] == 0x0A) { // Mux 10: BUILD_HWID_COMPONENTID
|
||||
if (BMS_info_buildConfigId == 0) {
|
||||
BMS_info_buildConfigId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 16, 16));
|
||||
}
|
||||
if (BMS_info_hardwareId == 0) {
|
||||
BMS_info_hardwareId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 32, 16));
|
||||
}
|
||||
if (BMS_info_componentId == 0) {
|
||||
BMS_info_componentId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 48, 16));
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (rx_frame.data.u8[0] == 0x0B) { // Mux 11: PCBAID_ASSYID_USAGEID
|
||||
if (BMS_info_pcbaId == 0) {BMS_info_pcbaId = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 16, 8));}
|
||||
if (BMS_info_assemblyId == 0) {BMS_info_assemblyId = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 24, 8));}
|
||||
if (BMS_info_usageId == 0) {BMS_info_usageId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 32, 16));}
|
||||
if (BMS_info_subUsageId == 0) {BMS_info_subUsageId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 48, 16));}
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x0D) { // Mux 13: APP_CRC
|
||||
if (BMS_info_platformType == 0) {BMS_info_platformType = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 8, 8));}
|
||||
if (BMS_info_appCrc == 0) {BMS_info_appCrc = static_cast<uint32_t>(extract_signal_value(rx_frame.data.u8, 32, 32));}
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x12) { // Mux 18: BOOTLOADER_GITHASH
|
||||
if (BMS_info_bootGitHash == 0) {BMS_info_bootGitHash = static_cast<uint64_t>(extract_signal_value(rx_frame.data.u8, 10, 54));}
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x14) { // Mux 20: UDS_PROTOCOL_BOOTCRC
|
||||
if (BMS_info_bootUdsProtoVersion == 0) {BMS_info_bootUdsProtoVersion = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 8, 8));}
|
||||
if (BMS_info_bootCrc == 0) {BMS_info_bootCrc = static_cast<uint32_t>(extract_signal_value(rx_frame.data.u8, 32, 32));}
|
||||
}
|
||||
*/
|
||||
break;
|
||||
case 0x3C4: //PCS_info
|
||||
//Display internal PCS info and other build/version data
|
||||
if (rx_frame.data.u8[0] == 0x0A) { // Mux 10: BUILD_HWID_COMPONENTID
|
||||
if (PCS_info_buildConfigId == 0) {
|
||||
PCS_info_buildConfigId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 16, 16));
|
||||
}
|
||||
if (PCS_info_hardwareId == 0) {
|
||||
PCS_info_hardwareId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 32, 16));
|
||||
}
|
||||
if (PCS_info_componentId == 0) {
|
||||
PCS_info_componentId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 48, 16));
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (rx_frame.data.u8[0] == 0x0B) { // Mux 11: PCBAID_ASSYID_USAGEID
|
||||
if (PCS_info_pcbaId == 0) {PCS_info_pcbaId = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 16, 8));}
|
||||
if (PCS_info_assemblyId == 0) {PCS_info_assemblyId = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 24, 8));}
|
||||
if (PCS_info_usageId == 0) {PCS_info_usageId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 32, 16));}
|
||||
if (PCS_info_subUsageId == 0) {PCS_info_subUsageId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 48, 16));}
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x0D) { // Mux 13: APP_CRC
|
||||
PCS_info_platformType = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 8, 8));
|
||||
PCS_info_appCrc = static_cast<uint32_t>(extract_signal_value(rx_frame.data.u8, 32, 32));
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x10) { // Mux 16: SUBCOMPONENT
|
||||
PCS_info_cpu2AppCrc = static_cast<uint32_t>(extract_signal_value(rx_frame.data.u8, 32, 32));
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x12) { // Mux 18: BOOTLOADER_GITHASH
|
||||
PCS_info_bootGitHash = static_cast<uint64_t>(extract_signal_value(rx_frame.data.u8, 10, 54));
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x14) { // Mux 20: UDS_PROTOCOL_BOOTCRC
|
||||
PCS_info_bootUdsProtoVersion = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 8, 8));
|
||||
PCS_info_bootCrc = static_cast<uint32_t>(extract_signal_value(rx_frame.data.u8, 32, 32));
|
||||
}
|
||||
*/
|
||||
//PCS Part Number in ASCII
|
||||
if (rx_frame.data.u8[0] == 0x19 && !parsed_PCS_partNumber) { // Part number 1-7
|
||||
PCS_partNumber[0] = rx_frame.data.u8[1];
|
||||
PCS_partNumber[1] = rx_frame.data.u8[2];
|
||||
PCS_partNumber[2] = rx_frame.data.u8[3];
|
||||
PCS_partNumber[3] = rx_frame.data.u8[4];
|
||||
PCS_partNumber[4] = rx_frame.data.u8[5];
|
||||
PCS_partNumber[5] = rx_frame.data.u8[6];
|
||||
PCS_partNumber[6] = rx_frame.data.u8[7];
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x1A && !parsed_PCS_partNumber) { // Part number 8-14
|
||||
PCS_partNumber[7] = rx_frame.data.u8[1];
|
||||
PCS_partNumber[8] = rx_frame.data.u8[2];
|
||||
PCS_partNumber[9] = rx_frame.data.u8[3];
|
||||
PCS_partNumber[10] = rx_frame.data.u8[4];
|
||||
PCS_partNumber[11] = rx_frame.data.u8[5];
|
||||
PCS_partNumber[12] = rx_frame.data.u8[6];
|
||||
}
|
||||
if (PCS_partNumber[6] != 0 && PCS_partNumber[11] != 0) {
|
||||
parsed_PCS_partNumber = true;
|
||||
}
|
||||
break;
|
||||
case 0x310: //HVP_info
|
||||
//Display internal HVP info and other build/version data
|
||||
if (rx_frame.data.u8[0] == 0x0A) { // Mux 10: BUILD_HWID_COMPONENTID
|
||||
if (HVP_info_buildConfigId == 0) {
|
||||
HVP_info_buildConfigId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 16, 16));
|
||||
}
|
||||
if (HVP_info_hardwareId == 0) {
|
||||
HVP_info_hardwareId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 32, 16));
|
||||
}
|
||||
if (HVP_info_componentId == 0) {
|
||||
HVP_info_componentId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 48, 16));
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (rx_frame.data.u8[0] == 0x0B) { // Mux 11: PCBAID_ASSYID_USAGEID
|
||||
if (HVP_info_pcbaId == 0) {HVP_info_pcbaId = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 16, 8));}
|
||||
if (HVP_info_assemblyId == 0) {HVP_info_assemblyId = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 24, 8));}
|
||||
if (HVP_info_usageId == 0) {HVP_info_usageId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 32, 16));}
|
||||
if (HVP_info_subUsageId == 0) {HVP_info_subUsageId = static_cast<uint16_t>(extract_signal_value(rx_frame.data.u8, 48, 16));}
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x0D) { // Mux 13: APP_CRC
|
||||
HVP_info_platformType = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 8, 8));
|
||||
HVP_info_appCrc = static_cast<uint32_t>(extract_signal_value(rx_frame.data.u8, 32, 32));
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x12) { // Mux 18: BOOTLOADER_GITHASH
|
||||
HVP_info_bootGitHash = static_cast<uint64_t>(extract_signal_value(rx_frame.data.u8, 10, 54));
|
||||
}
|
||||
if (rx_frame.data.u8[0] == 0x14) { // Mux 20: UDS_PROTOCOL_BOOTCRC
|
||||
HVP_info_bootUdsProtoVersion = static_cast<uint8_t>(extract_signal_value(rx_frame.data.u8, 8, 8));
|
||||
HVP_info_bootCrc = static_cast<uint32_t>(extract_signal_value(rx_frame.data.u8, 32, 32));
|
||||
}
|
||||
*/
|
||||
break;
|
||||
case 0x612: // CAN UDSs for BMS
|
||||
//BMS Query
|
||||
if (stateMachineBMSQuery != 0xFF && stateMachineBMSReset == 0xFF) {
|
||||
if (memcmp(rx_frame.data.u8, "\x02\x50\x03\xAA\xAA\xAA\xAA\xAA", 8) == 0) {
|
||||
//Received initial response, proceed to actual query
|
||||
#ifdef DEBUG_LOG
|
||||
logging.println("CAN UDS: Received BMS query initial handshake reply");
|
||||
#endif //DEBUG_LOG
|
||||
stateMachineBMSQuery = 1;
|
||||
break;
|
||||
}
|
||||
if (memcmp(&rx_frame.data.u8[0], "\x10", 1) == 0) {
|
||||
//Received first data frame
|
||||
battery_partNumber[0] = rx_frame.data.u8[5];
|
||||
battery_partNumber[1] = rx_frame.data.u8[6];
|
||||
battery_partNumber[2] = rx_frame.data.u8[7];
|
||||
#ifdef DEBUG_LOG
|
||||
logging.println("CAN UDS: Received BMS query data frame");
|
||||
#endif //DEBUG_LOG
|
||||
stateMachineBMSQuery = 2;
|
||||
break;
|
||||
}
|
||||
if (memcmp(&rx_frame.data.u8[0], "\x21", 1) == 0) {
|
||||
//Second part of part number after flow control
|
||||
battery_partNumber[3] = rx_frame.data.u8[1];
|
||||
battery_partNumber[4] = rx_frame.data.u8[2];
|
||||
battery_partNumber[5] = rx_frame.data.u8[3];
|
||||
battery_partNumber[6] = rx_frame.data.u8[4];
|
||||
battery_partNumber[7] = rx_frame.data.u8[5];
|
||||
battery_partNumber[8] = rx_frame.data.u8[6];
|
||||
battery_partNumber[9] = rx_frame.data.u8[7];
|
||||
#ifdef DEBUG_LOG
|
||||
logging.println("CAN UDS: Received BMS query second data frame");
|
||||
#endif //DEBUG_LOG
|
||||
break;
|
||||
}
|
||||
if (memcmp(&rx_frame.data.u8[0], "\x22", 1) == 0) {
|
||||
//Final part of part number
|
||||
battery_partNumber[10] = rx_frame.data.u8[1];
|
||||
battery_partNumber[11] = rx_frame.data.u8[2];
|
||||
#ifdef DEBUG_LOG
|
||||
logging.println("CAN UDS: Received BMS query final data frame");
|
||||
#endif //DEBUG_LOG
|
||||
break;
|
||||
}
|
||||
if (memcmp(rx_frame.data.u8, "\x23\x00\x00\x00\xAA\xAA\xAA\xAA", 8) == 0) {
|
||||
//Received final frame
|
||||
#ifdef DEBUG_LOG
|
||||
logging.println("CAN UDS: Received BMS query termination frame");
|
||||
#endif //DEBUG_LOG
|
||||
parsed_battery_partNumber = true;
|
||||
stateMachineBMSQuery = 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//BMS Reset
|
||||
#ifdef DEBUG_LOG
|
||||
if (stateMachineBMSQuery == 0xFF) { // Make sure this is reset request not query
|
||||
if (memcmp(rx_frame.data.u8, "\x02\x67\x06\xAA\xAA\xAA\xAA\xAA", 8) == 0) {
|
||||
logging.println("CAN UDS: ECU unlocked");
|
||||
} else if (memcmp(rx_frame.data.u8, "\x03\x7F\x11\x78\xAA\xAA\xAA\xAA", 8) == 0) {
|
||||
logging.println("CAN UDS: ECU reset request successful but ECU busy, response pending");
|
||||
} else if (memcmp(rx_frame.data.u8, "\x02\x51\x01\xAA\xAA\xAA\xAA\xAA", 8) == 0) {
|
||||
logging.println("CAN UDS: ECU reset positive response, 1 second downtime");
|
||||
}
|
||||
}
|
||||
#endif //DEBUG_LOG
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -2148,18 +2368,18 @@ void printDebugIfActive(uint8_t symbol, const char* message) {
|
|||
}
|
||||
|
||||
void TeslaBattery::printFaultCodesIfActive() {
|
||||
if (battery_packCtrsClosingAllowed == 0) {
|
||||
logging.println(
|
||||
"ERROR: Check high voltage connectors and interlock circuit! Closing contactor not allowed! Values: ");
|
||||
if (battery_packCtrsClosingBlocked &&
|
||||
battery_packContactorSetState != 5) { // Contactors blocked closing and not already closed
|
||||
logging.println("ERROR: Check high voltage connectors and interlock circuit, closing contactors not allowed!");
|
||||
}
|
||||
if (battery_pyroTestInProgress == 1) {
|
||||
logging.println("ERROR: Please wait for Pyro Connection check to finish, HV cables successfully seated!");
|
||||
if (battery_pyroTestInProgress) {
|
||||
logging.println("ERROR: Please wait for pyro test to finish, HV cables successfully seated!");
|
||||
}
|
||||
if (datalayer.system.status.inverter_allows_contactor_closing == false) {
|
||||
logging.println(
|
||||
"ERROR: Solar inverter does not allow for contactor closing. Check communication connection to the inverter "
|
||||
"OR "
|
||||
"disable the inverter protocol to proceed with contactor closing");
|
||||
"or "
|
||||
"disable the inverter protocol to proceed in Tesla battery testing mode.");
|
||||
}
|
||||
// Check each symbol and print debug information if its value is 1
|
||||
// 0X3AA: 938 HVP_alertMatrix1
|
||||
|
@ -2177,20 +2397,20 @@ void TeslaBattery::printFaultCodesIfActive() {
|
|||
printDebugIfActive(battery_OverVoltageFault, "ERROR: A brick voltage is above maximum voltage limit");
|
||||
printDebugIfActive(battery_UnderVoltageFault, "ERROR: A brick voltage is below minimum voltage limit");
|
||||
printDebugIfActive(battery_PrimaryBmbMiaFault,
|
||||
"ERROR: voltage and temperature readings from primary BMB chain are mia");
|
||||
"ERROR: Voltage and temperature readings from primary BMB chain are mia");
|
||||
printDebugIfActive(battery_SecondaryBmbMiaFault,
|
||||
"ERROR: voltage and temperature readings from secondary BMB chain are mia");
|
||||
"ERROR: Voltage and temperature readings from secondary BMB chain are mia");
|
||||
printDebugIfActive(battery_BmbMismatchFault,
|
||||
"ERROR: primary and secondary BMB chain readings don't match with each other");
|
||||
"ERROR: Primary and secondary BMB chain readings don't match with each other");
|
||||
printDebugIfActive(battery_BmsHviMiaFault, "ERROR: BMS node is mia on HVS or HVI CAN");
|
||||
//printDebugIfActive(battery_CpMiaFault, "ERROR: CP node is mia on HVS CAN"); //Uncommented due to not affecting usage
|
||||
printDebugIfActive(battery_PcsMiaFault, "ERROR: PCS node is mia on HVS CAN");
|
||||
//printDebugIfActive(battery_BmsFault, "ERROR: BmsFault is active"); //Uncommented due to not affecting usage
|
||||
printDebugIfActive(battery_PcsFault, "ERROR: PcsFault is active");
|
||||
//printDebugIfActive(battery_CpFault, "ERROR: CpFault is active"); //Uncommented due to not affecting usage
|
||||
printDebugIfActive(battery_ShuntHwMiaFault, "ERROR: shunt current reading is not available");
|
||||
printDebugIfActive(battery_PyroMiaFault, "ERROR: pyro squib is not connected");
|
||||
printDebugIfActive(battery_hvsMiaFault, "ERROR: pack contactor hw fault");
|
||||
printDebugIfActive(battery_ShuntHwMiaFault, "ERROR: Shunt current reading is not available");
|
||||
printDebugIfActive(battery_PyroMiaFault, "ERROR: Pyro squib is not connected");
|
||||
printDebugIfActive(battery_hvsMiaFault, "ERROR: Pack contactor hw fault");
|
||||
printDebugIfActive(battery_hviMiaFault, "ERROR: FC contactor hw fault");
|
||||
printDebugIfActive(battery_Supply12vFault, "ERROR: Low voltage (12V) battery is below minimum voltage threshold");
|
||||
printDebugIfActive(battery_VerSupplyFault, "ERROR: Energy reserve voltage supply is below minimum voltage threshold");
|
||||
|
@ -2222,97 +2442,97 @@ void TeslaBattery::printFaultCodesIfActive() {
|
|||
printDebugIfActive(battery_fcCtrCloseFailed, "ERROR: fcCtrCloseFailed is active");
|
||||
printDebugIfActive(battery_shuntThermistorMia, "ERROR: shuntThermistorMia is active");
|
||||
// 0x320 800 BMS_alertMatrix
|
||||
printDebugIfActive(battery_BMS_a017_SW_Brick_OV, "ERROR: BMS_a017_SW_Brick_OV");
|
||||
printDebugIfActive(battery_BMS_a018_SW_Brick_UV, "ERROR: BMS_a018_SW_Brick_UV");
|
||||
printDebugIfActive(battery_BMS_a019_SW_Module_OT, "ERROR: BMS_a019_SW_Module_OT");
|
||||
printDebugIfActive(battery_BMS_a021_SW_Dr_Limits_Regulation, "ERROR: BMS_a021_SW_Dr_Limits_Regulation");
|
||||
//printDebugIfActive(battery_BMS_a022_SW_Over_Current, "ERROR: BMS_a022_SW_Over_Current");
|
||||
printDebugIfActive(battery_BMS_a023_SW_Stack_OV, "ERROR: BMS_a023_SW_Stack_OV");
|
||||
printDebugIfActive(battery_BMS_a024_SW_Islanded_Brick, "ERROR: BMS_a024_SW_Islanded_Brick");
|
||||
printDebugIfActive(battery_BMS_a025_SW_PwrBalance_Anomaly, "ERROR: BMS_a025_SW_PwrBalance_Anomaly");
|
||||
printDebugIfActive(battery_BMS_a026_SW_HFCurrent_Anomaly, "ERROR: BMS_a026_SW_HFCurrent_Anomaly");
|
||||
printDebugIfActive(battery_BMS_a034_SW_Passive_Isolation, "ERROR: BMS_a034_SW_Passive_Isolation");
|
||||
printDebugIfActive(battery_BMS_a035_SW_Isolation, "ERROR: BMS_a035_SW_Isolation");
|
||||
printDebugIfActive(battery_BMS_a036_SW_HvpHvilFault, "ERROR: BMS_a036_SW_HvpHvilFault");
|
||||
printDebugIfActive(battery_BMS_a037_SW_Flood_Port_Open, "ERROR: BMS_a037_SW_Flood_Port_Open");
|
||||
printDebugIfActive(battery_BMS_a039_SW_DC_Link_Over_Voltage, "ERROR: BMS_a039_SW_DC_Link_Over_Voltage");
|
||||
printDebugIfActive(battery_BMS_a041_SW_Power_On_Reset, "ERROR: BMS_a041_SW_Power_On_Reset");
|
||||
printDebugIfActive(battery_BMS_a042_SW_MPU_Error, "ERROR: BMS_a042_SW_MPU_Error");
|
||||
printDebugIfActive(battery_BMS_a043_SW_Watch_Dog_Reset, "ERROR: BMS_a043_SW_Watch_Dog_Reset");
|
||||
printDebugIfActive(battery_BMS_a044_SW_Assertion, "ERROR: BMS_a044_SW_Assertion");
|
||||
printDebugIfActive(battery_BMS_a045_SW_Exception, "ERROR: BMS_a045_SW_Exception");
|
||||
printDebugIfActive(battery_BMS_a046_SW_Task_Stack_Usage, "ERROR: BMS_a046_SW_Task_Stack_Usage");
|
||||
printDebugIfActive(battery_BMS_a047_SW_Task_Stack_Overflow, "ERROR: BMS_a047_SW_Task_Stack_Overflow");
|
||||
printDebugIfActive(battery_BMS_a048_SW_Log_Upload_Request, "ERROR: BMS_a048_SW_Log_Upload_Request");
|
||||
//printDebugIfActive(battery_BMS_a050_SW_Brick_Voltage_MIA, "ERROR: BMS_a050_SW_Brick_Voltage_MIA");
|
||||
printDebugIfActive(battery_BMS_a051_SW_HVC_Vref_Bad, "ERROR: BMS_a051_SW_HVC_Vref_Bad");
|
||||
printDebugIfActive(battery_BMS_a052_SW_PCS_MIA, "ERROR: BMS_a052_SW_PCS_MIA");
|
||||
printDebugIfActive(battery_BMS_a053_SW_ThermalModel_Sanity, "ERROR: BMS_a053_SW_ThermalModel_Sanity");
|
||||
printDebugIfActive(battery_BMS_a054_SW_Ver_Supply_Fault, "ERROR: BMS_a054_SW_Ver_Supply_Fault");
|
||||
printDebugIfActive(battery_BMS_a059_SW_Pack_Voltage_Sensing, "ERROR: BMS_a059_SW_Pack_Voltage_Sensing");
|
||||
printDebugIfActive(battery_BMS_a060_SW_Leakage_Test_Failure, "ERROR: BMS_a060_SW_Leakage_Test_Failure");
|
||||
printDebugIfActive(battery_BMS_a061_robinBrickOverVoltage, "ERROR: BMS_a061_robinBrickOverVoltage");
|
||||
printDebugIfActive(battery_BMS_a062_SW_BrickV_Imbalance, "ERROR: BMS_a062_SW_BrickV_Imbalance");
|
||||
printDebugIfActive(battery_BMS_a063_SW_ChargePort_Fault, "ERROR: BMS_a063_SW_ChargePort_Fault");
|
||||
printDebugIfActive(battery_BMS_a064_SW_SOC_Imbalance, "ERROR: BMS_a064_SW_SOC_Imbalance");
|
||||
printDebugIfActive(battery_BMS_a069_SW_Low_Power, "ERROR: BMS_a069_SW_Low_Power");
|
||||
printDebugIfActive(battery_BMS_a071_SW_SM_TransCon_Not_Met, "ERROR: BMS_a071_SW_SM_TransCon_Not_Met");
|
||||
printDebugIfActive(battery_BMS_a075_SW_Chg_Disable_Failure, "ERROR: BMS_a075_SW_Chg_Disable_Failure");
|
||||
printDebugIfActive(battery_BMS_a076_SW_Dch_While_Charging, "ERROR: BMS_a076_SW_Dch_While_Charging");
|
||||
printDebugIfActive(battery_BMS_a077_SW_Charger_Regulation, "ERROR: BMS_a077_SW_Charger_Regulation");
|
||||
printDebugIfActive(battery_BMS_a081_SW_Ctr_Close_Blocked, "ERROR: BMS_a081_SW_Ctr_Close_Blocked");
|
||||
printDebugIfActive(battery_BMS_a082_SW_Ctr_Force_Open, "ERROR: BMS_a082_SW_Ctr_Force_Open");
|
||||
printDebugIfActive(battery_BMS_a083_SW_Ctr_Close_Failure, "ERROR: BMS_a083_SW_Ctr_Close_Failure");
|
||||
printDebugIfActive(battery_BMS_a084_SW_Sleep_Wake_Aborted, "ERROR: BMS_a084_SW_Sleep_Wake_Aborted");
|
||||
printDebugIfActive(battery_BMS_a087_SW_Feim_Test_Blocked, "ERROR: BMS_a087_SW_Feim_Test_Blocked");
|
||||
printDebugIfActive(battery_BMS_a088_SW_VcFront_MIA_InDrive, "ERROR: BMS_a088_SW_VcFront_MIA_InDrive");
|
||||
printDebugIfActive(battery_BMS_a089_SW_VcFront_MIA, "ERROR: BMS_a089_SW_VcFront_MIA");
|
||||
//printDebugIfActive(battery_BMS_a090_SW_Gateway_MIA, "ERROR: BMS_a090_SW_Gateway_MIA");
|
||||
//printDebugIfActive(battery_BMS_a091_SW_ChargePort_MIA, "ERROR: BMS_a091_SW_ChargePort_MIA");
|
||||
//printDebugIfActive(battery_BMS_a092_SW_ChargePort_Mia_On_Hv, "ERROR: BMS_a092_SW_ChargePort_Mia_On_Hv");
|
||||
//printDebugIfActive(battery_BMS_a094_SW_Drive_Inverter_MIA, "ERROR: BMS_a094_SW_Drive_Inverter_MIA");
|
||||
printDebugIfActive(battery_BMS_a099_SW_BMB_Communication, "ERROR: BMS_a099_SW_BMB_Communication");
|
||||
printDebugIfActive(battery_BMS_a105_SW_One_Module_Tsense, "ERROR: BMS_a105_SW_One_Module_Tsense");
|
||||
printDebugIfActive(battery_BMS_a106_SW_All_Module_Tsense, "ERROR: BMS_a106_SW_All_Module_Tsense");
|
||||
printDebugIfActive(battery_BMS_a107_SW_Stack_Voltage_MIA, "ERROR: BMS_a107_SW_Stack_Voltage_MIA");
|
||||
printDebugIfActive(battery_BMS_a121_SW_NVRAM_Config_Error, "ERROR: BMS_a121_SW_NVRAM_Config_Error");
|
||||
printDebugIfActive(battery_BMS_a122_SW_BMS_Therm_Irrational, "ERROR: BMS_a122_SW_BMS_Therm_Irrational");
|
||||
printDebugIfActive(battery_BMS_a123_SW_Internal_Isolation, "ERROR: BMS_a123_SW_Internal_Isolation");
|
||||
printDebugIfActive(battery_BMS_a127_SW_shunt_SNA, "ERROR: BMS_a127_SW_shunt_SNA");
|
||||
printDebugIfActive(battery_BMS_a128_SW_shunt_MIA, "ERROR: BMS_a128_SW_shunt_MIA");
|
||||
printDebugIfActive(battery_BMS_a129_SW_VSH_Failure, "ERROR: BMS_a129_SW_VSH_Failure");
|
||||
printDebugIfActive(battery_BMS_a130_IO_CAN_Error, "ERROR: BMS_a130_IO_CAN_Error");
|
||||
printDebugIfActive(battery_BMS_a131_Bleed_FET_Failure, "ERROR: BMS_a131_Bleed_FET_Failure");
|
||||
printDebugIfActive(battery_BMS_a132_HW_BMB_OTP_Uncorrctbl, "ERROR: BMS_a132_HW_BMB_OTP_Uncorrctbl");
|
||||
printDebugIfActive(battery_BMS_a134_SW_Delayed_Ctr_Off, "ERROR: BMS_a134_SW_Delayed_Ctr_Off");
|
||||
printDebugIfActive(battery_BMS_a136_SW_Module_OT_Warning, "ERROR: BMS_a136_SW_Module_OT_Warning");
|
||||
printDebugIfActive(battery_BMS_a137_SW_Brick_UV_Warning, "ERROR: BMS_a137_SW_Brick_UV_Warning");
|
||||
printDebugIfActive(battery_BMS_a139_SW_DC_Link_V_Irrational, "ERROR: BMS_a139_SW_DC_Link_V_Irrational");
|
||||
printDebugIfActive(battery_BMS_a141_SW_BMB_Status_Warning, "ERROR: BMS_a141_SW_BMB_Status_Warning");
|
||||
printDebugIfActive(battery_BMS_a144_Hvp_Config_Mismatch, "ERROR: BMS_a144_Hvp_Config_Mismatch");
|
||||
printDebugIfActive(battery_BMS_a145_SW_SOC_Change, "ERROR: BMS_a145_SW_SOC_Change");
|
||||
printDebugIfActive(battery_BMS_a146_SW_Brick_Overdischarged, "ERROR: BMS_a146_SW_Brick_Overdischarged");
|
||||
printDebugIfActive(battery_BMS_a149_SW_Missing_Config_Block, "ERROR: BMS_a149_SW_Missing_Config_Block");
|
||||
printDebugIfActive(battery_BMS_a151_SW_external_isolation, "ERROR: BMS_a151_SW_external_isolation");
|
||||
printDebugIfActive(battery_BMS_a156_SW_BMB_Vref_bad, "ERROR: BMS_a156_SW_BMB_Vref_bad");
|
||||
printDebugIfActive(battery_BMS_a157_SW_HVP_HVS_Comms, "ERROR: BMS_a157_SW_HVP_HVS_Comms");
|
||||
printDebugIfActive(battery_BMS_a158_SW_HVP_HVI_Comms, "ERROR: BMS_a158_SW_HVP_HVI_Comms");
|
||||
printDebugIfActive(battery_BMS_a159_SW_HVP_ECU_Error, "ERROR: BMS_a159_SW_HVP_ECU_Error");
|
||||
printDebugIfActive(battery_BMS_a161_SW_DI_Open_Request, "ERROR: BMS_a161_SW_DI_Open_Request");
|
||||
printDebugIfActive(battery_BMS_a162_SW_No_Power_For_Support, "ERROR: BMS_a162_SW_No_Power_For_Support");
|
||||
printDebugIfActive(battery_BMS_a163_SW_Contactor_Mismatch, "ERROR: BMS_a163_SW_Contactor_Mismatch");
|
||||
printDebugIfActive(battery_BMS_a164_SW_Uncontrolled_Regen, "ERROR: BMS_a164_SW_Uncontrolled_Regen");
|
||||
printDebugIfActive(battery_BMS_a165_SW_Pack_Partial_Weld, "ERROR: BMS_a165_SW_Pack_Partial_Weld");
|
||||
printDebugIfActive(battery_BMS_a166_SW_Pack_Full_Weld, "ERROR: BMS_a166_SW_Pack_Full_Weld");
|
||||
printDebugIfActive(battery_BMS_a167_SW_FC_Partial_Weld, "ERROR: BMS_a167_SW_FC_Partial_Weld");
|
||||
printDebugIfActive(battery_BMS_a168_SW_FC_Full_Weld, "ERROR: BMS_a168_SW_FC_Full_Weld");
|
||||
printDebugIfActive(battery_BMS_a169_SW_FC_Pack_Weld, "ERROR: BMS_a169_SW_FC_Pack_Weld");
|
||||
//printDebugIfActive(battery_BMS_a170_SW_Limp_Mode, "ERROR: BMS_a170_SW_Limp_Mode");
|
||||
printDebugIfActive(battery_BMS_a171_SW_Stack_Voltage_Sense, "ERROR: BMS_a171_SW_Stack_Voltage_Sense");
|
||||
printDebugIfActive(battery_BMS_a174_SW_Charge_Failure, "ERROR: BMS_a174_SW_Charge_Failure");
|
||||
printDebugIfActive(battery_BMS_a176_SW_GracefulPowerOff, "ERROR: BMS_a176_SW_GracefulPowerOff");
|
||||
printDebugIfActive(battery_BMS_a179_SW_Hvp_12V_Fault, "ERROR: BMS_a179_SW_Hvp_12V_Fault");
|
||||
printDebugIfActive(battery_BMS_a180_SW_ECU_reset_blocked, "ERROR: BMS_a180_SW_ECU_reset_blocked");
|
||||
printDebugIfActive(BMS_a017_SW_Brick_OV, "ERROR: BMS_a017_SW_Brick_OV");
|
||||
printDebugIfActive(BMS_a018_SW_Brick_UV, "ERROR: BMS_a018_SW_Brick_UV");
|
||||
printDebugIfActive(BMS_a019_SW_Module_OT, "ERROR: BMS_a019_SW_Module_OT");
|
||||
printDebugIfActive(BMS_a021_SW_Dr_Limits_Regulation, "ERROR: BMS_a021_SW_Dr_Limits_Regulation");
|
||||
//printDebugIfActive(BMS_a022_SW_Over_Current, "ERROR: BMS_a022_SW_Over_Current");
|
||||
printDebugIfActive(BMS_a023_SW_Stack_OV, "ERROR: BMS_a023_SW_Stack_OV");
|
||||
printDebugIfActive(BMS_a024_SW_Islanded_Brick, "ERROR: BMS_a024_SW_Islanded_Brick");
|
||||
printDebugIfActive(BMS_a025_SW_PwrBalance_Anomaly, "ERROR: BMS_a025_SW_PwrBalance_Anomaly");
|
||||
printDebugIfActive(BMS_a026_SW_HFCurrent_Anomaly, "ERROR: BMS_a026_SW_HFCurrent_Anomaly");
|
||||
printDebugIfActive(BMS_a034_SW_Passive_Isolation, "ERROR: BMS_a034_SW_Passive_Isolation");
|
||||
printDebugIfActive(BMS_a035_SW_Isolation, "ERROR: BMS_a035_SW_Isolation");
|
||||
printDebugIfActive(BMS_a036_SW_HvpHvilFault, "ERROR: BMS_a036_SW_HvpHvilFault");
|
||||
printDebugIfActive(BMS_a037_SW_Flood_Port_Open, "ERROR: BMS_a037_SW_Flood_Port_Open");
|
||||
printDebugIfActive(BMS_a039_SW_DC_Link_Over_Voltage, "ERROR: BMS_a039_SW_DC_Link_Over_Voltage");
|
||||
printDebugIfActive(BMS_a041_SW_Power_On_Reset, "ERROR: BMS_a041_SW_Power_On_Reset");
|
||||
printDebugIfActive(BMS_a042_SW_MPU_Error, "ERROR: BMS_a042_SW_MPU_Error");
|
||||
printDebugIfActive(BMS_a043_SW_Watch_Dog_Reset, "ERROR: BMS_a043_SW_Watch_Dog_Reset");
|
||||
printDebugIfActive(BMS_a044_SW_Assertion, "ERROR: BMS_a044_SW_Assertion");
|
||||
printDebugIfActive(BMS_a045_SW_Exception, "ERROR: BMS_a045_SW_Exception");
|
||||
printDebugIfActive(BMS_a046_SW_Task_Stack_Usage, "ERROR: BMS_a046_SW_Task_Stack_Usage");
|
||||
printDebugIfActive(BMS_a047_SW_Task_Stack_Overflow, "ERROR: BMS_a047_SW_Task_Stack_Overflow");
|
||||
printDebugIfActive(BMS_a048_SW_Log_Upload_Request, "ERROR: BMS_a048_SW_Log_Upload_Request");
|
||||
//printDebugIfActive(BMS_a050_SW_Brick_Voltage_MIA, "ERROR: BMS_a050_SW_Brick_Voltage_MIA");
|
||||
printDebugIfActive(BMS_a051_SW_HVC_Vref_Bad, "ERROR: BMS_a051_SW_HVC_Vref_Bad");
|
||||
printDebugIfActive(BMS_a052_SW_PCS_MIA, "ERROR: BMS_a052_SW_PCS_MIA");
|
||||
printDebugIfActive(BMS_a053_SW_ThermalModel_Sanity, "ERROR: BMS_a053_SW_ThermalModel_Sanity");
|
||||
printDebugIfActive(BMS_a054_SW_Ver_Supply_Fault, "ERROR: BMS_a054_SW_Ver_Supply_Fault");
|
||||
printDebugIfActive(BMS_a059_SW_Pack_Voltage_Sensing, "ERROR: BMS_a059_SW_Pack_Voltage_Sensing");
|
||||
printDebugIfActive(BMS_a060_SW_Leakage_Test_Failure, "ERROR: BMS_a060_SW_Leakage_Test_Failure");
|
||||
printDebugIfActive(BMS_a061_robinBrickOverVoltage, "ERROR: BMS_a061_robinBrickOverVoltage");
|
||||
printDebugIfActive(BMS_a062_SW_BrickV_Imbalance, "ERROR: BMS_a062_SW_BrickV_Imbalance");
|
||||
//printDebugIfActive(BMS_a063_SW_ChargePort_Fault, "ERROR: BMS_a063_SW_ChargePort_Fault");
|
||||
printDebugIfActive(BMS_a064_SW_SOC_Imbalance, "ERROR: BMS_a064_SW_SOC_Imbalance");
|
||||
printDebugIfActive(BMS_a069_SW_Low_Power, "ERROR: BMS_a069_SW_Low_Power");
|
||||
printDebugIfActive(BMS_a071_SW_SM_TransCon_Not_Met, "ERROR: BMS_a071_SW_SM_TransCon_Not_Met");
|
||||
printDebugIfActive(BMS_a075_SW_Chg_Disable_Failure, "ERROR: BMS_a075_SW_Chg_Disable_Failure");
|
||||
printDebugIfActive(BMS_a076_SW_Dch_While_Charging, "ERROR: BMS_a076_SW_Dch_While_Charging");
|
||||
printDebugIfActive(BMS_a077_SW_Charger_Regulation, "ERROR: BMS_a077_SW_Charger_Regulation");
|
||||
printDebugIfActive(BMS_a081_SW_Ctr_Close_Blocked, "ERROR: BMS_a081_SW_Ctr_Close_Blocked");
|
||||
printDebugIfActive(BMS_a082_SW_Ctr_Force_Open, "ERROR: BMS_a082_SW_Ctr_Force_Open");
|
||||
printDebugIfActive(BMS_a083_SW_Ctr_Close_Failure, "ERROR: BMS_a083_SW_Ctr_Close_Failure");
|
||||
printDebugIfActive(BMS_a084_SW_Sleep_Wake_Aborted, "ERROR: BMS_a084_SW_Sleep_Wake_Aborted");
|
||||
printDebugIfActive(BMS_a087_SW_Feim_Test_Blocked, "ERROR: BMS_a087_SW_Feim_Test_Blocked");
|
||||
printDebugIfActive(BMS_a088_SW_VcFront_MIA_InDrive, "ERROR: BMS_a088_SW_VcFront_MIA_InDrive");
|
||||
printDebugIfActive(BMS_a089_SW_VcFront_MIA, "ERROR: BMS_a089_SW_VcFront_MIA");
|
||||
printDebugIfActive(BMS_a090_SW_Gateway_MIA, "ERROR: BMS_a090_SW_Gateway_MIA");
|
||||
//printDebugIfActive(BMS_a091_SW_ChargePort_MIA, "ERROR: BMS_a091_SW_ChargePort_MIA");
|
||||
//printDebugIfActive(BMS_a092_SW_ChargePort_Mia_On_Hv, "ERROR: BMS_a092_SW_ChargePort_Mia_On_Hv");
|
||||
//printDebugIfActive(BMS_a094_SW_Drive_Inverter_MIA, "ERROR: BMS_a094_SW_Drive_Inverter_MIA");
|
||||
printDebugIfActive(BMS_a099_SW_BMB_Communication, "ERROR: BMS_a099_SW_BMB_Communication");
|
||||
printDebugIfActive(BMS_a105_SW_One_Module_Tsense, "ERROR: BMS_a105_SW_One_Module_Tsense");
|
||||
printDebugIfActive(BMS_a106_SW_All_Module_Tsense, "ERROR: BMS_a106_SW_All_Module_Tsense");
|
||||
printDebugIfActive(BMS_a107_SW_Stack_Voltage_MIA, "ERROR: BMS_a107_SW_Stack_Voltage_MIA");
|
||||
printDebugIfActive(BMS_a121_SW_NVRAM_Config_Error, "ERROR: BMS_a121_SW_NVRAM_Config_Error");
|
||||
printDebugIfActive(BMS_a122_SW_BMS_Therm_Irrational, "ERROR: BMS_a122_SW_BMS_Therm_Irrational");
|
||||
printDebugIfActive(BMS_a123_SW_Internal_Isolation, "ERROR: BMS_a123_SW_Internal_Isolation");
|
||||
printDebugIfActive(BMS_a127_SW_shunt_SNA, "ERROR: BMS_a127_SW_shunt_SNA");
|
||||
printDebugIfActive(BMS_a128_SW_shunt_MIA, "ERROR: BMS_a128_SW_shunt_MIA");
|
||||
printDebugIfActive(BMS_a129_SW_VSH_Failure, "ERROR: BMS_a129_SW_VSH_Failure");
|
||||
printDebugIfActive(BMS_a130_IO_CAN_Error, "ERROR: BMS_a130_IO_CAN_Error");
|
||||
printDebugIfActive(BMS_a131_Bleed_FET_Failure, "ERROR: BMS_a131_Bleed_FET_Failure");
|
||||
printDebugIfActive(BMS_a132_HW_BMB_OTP_Uncorrctbl, "ERROR: BMS_a132_HW_BMB_OTP_Uncorrctbl");
|
||||
printDebugIfActive(BMS_a134_SW_Delayed_Ctr_Off, "ERROR: BMS_a134_SW_Delayed_Ctr_Off");
|
||||
printDebugIfActive(BMS_a136_SW_Module_OT_Warning, "ERROR: BMS_a136_SW_Module_OT_Warning");
|
||||
printDebugIfActive(BMS_a137_SW_Brick_UV_Warning, "ERROR: BMS_a137_SW_Brick_UV_Warning");
|
||||
printDebugIfActive(BMS_a139_SW_DC_Link_V_Irrational, "ERROR: BMS_a139_SW_DC_Link_V_Irrational");
|
||||
printDebugIfActive(BMS_a141_SW_BMB_Status_Warning, "ERROR: BMS_a141_SW_BMB_Status_Warning");
|
||||
printDebugIfActive(BMS_a144_Hvp_Config_Mismatch, "ERROR: BMS_a144_Hvp_Config_Mismatch");
|
||||
printDebugIfActive(BMS_a145_SW_SOC_Change, "ERROR: BMS_a145_SW_SOC_Change");
|
||||
printDebugIfActive(BMS_a146_SW_Brick_Overdischarged, "ERROR: BMS_a146_SW_Brick_Overdischarged");
|
||||
printDebugIfActive(BMS_a149_SW_Missing_Config_Block, "ERROR: BMS_a149_SW_Missing_Config_Block");
|
||||
printDebugIfActive(BMS_a151_SW_external_isolation, "ERROR: BMS_a151_SW_external_isolation");
|
||||
printDebugIfActive(BMS_a156_SW_BMB_Vref_bad, "ERROR: BMS_a156_SW_BMB_Vref_bad");
|
||||
printDebugIfActive(BMS_a157_SW_HVP_HVS_Comms, "ERROR: BMS_a157_SW_HVP_HVS_Comms");
|
||||
printDebugIfActive(BMS_a158_SW_HVP_HVI_Comms, "ERROR: BMS_a158_SW_HVP_HVI_Comms");
|
||||
printDebugIfActive(BMS_a159_SW_HVP_ECU_Error, "ERROR: BMS_a159_SW_HVP_ECU_Error");
|
||||
printDebugIfActive(BMS_a161_SW_DI_Open_Request, "ERROR: BMS_a161_SW_DI_Open_Request");
|
||||
printDebugIfActive(BMS_a162_SW_No_Power_For_Support, "ERROR: BMS_a162_SW_No_Power_For_Support");
|
||||
printDebugIfActive(BMS_a163_SW_Contactor_Mismatch, "ERROR: BMS_a163_SW_Contactor_Mismatch");
|
||||
printDebugIfActive(BMS_a164_SW_Uncontrolled_Regen, "ERROR: BMS_a164_SW_Uncontrolled_Regen");
|
||||
printDebugIfActive(BMS_a165_SW_Pack_Partial_Weld, "ERROR: BMS_a165_SW_Pack_Partial_Weld");
|
||||
printDebugIfActive(BMS_a166_SW_Pack_Full_Weld, "ERROR: BMS_a166_SW_Pack_Full_Weld");
|
||||
printDebugIfActive(BMS_a167_SW_FC_Partial_Weld, "ERROR: BMS_a167_SW_FC_Partial_Weld");
|
||||
printDebugIfActive(BMS_a168_SW_FC_Full_Weld, "ERROR: BMS_a168_SW_FC_Full_Weld");
|
||||
printDebugIfActive(BMS_a169_SW_FC_Pack_Weld, "ERROR: BMS_a169_SW_FC_Pack_Weld");
|
||||
//printDebugIfActive(BMS_a170_SW_Limp_Mode, "ERROR: BMS_a170_SW_Limp_Mode");
|
||||
printDebugIfActive(BMS_a171_SW_Stack_Voltage_Sense, "ERROR: BMS_a171_SW_Stack_Voltage_Sense");
|
||||
printDebugIfActive(BMS_a174_SW_Charge_Failure, "ERROR: BMS_a174_SW_Charge_Failure");
|
||||
printDebugIfActive(BMS_a176_SW_GracefulPowerOff, "ERROR: BMS_a176_SW_GracefulPowerOff");
|
||||
printDebugIfActive(BMS_a179_SW_Hvp_12V_Fault, "ERROR: BMS_a179_SW_Hvp_12V_Fault");
|
||||
printDebugIfActive(BMS_a180_SW_ECU_reset_blocked, "ERROR: BMS_a180_SW_ECU_reset_blocked");
|
||||
}
|
||||
|
||||
void TeslaModel3YBattery::setup(void) { // Performs one time setup at startup
|
||||
|
|
|
@ -518,8 +518,8 @@ class TeslaBattery : public CanBattery {
|
|||
//0x2d2: 722 BMSVAlimits
|
||||
uint16_t battery_max_discharge_current = 0;
|
||||
uint16_t battery_max_charge_current = 0;
|
||||
uint16_t battery_bms_max_voltage = 0;
|
||||
uint16_t battery_bms_min_voltage = 0;
|
||||
uint16_t BMS_max_voltage = 0;
|
||||
uint16_t BMS_min_voltage = 0;
|
||||
//0x2b4: 692 PCS_dcdcRailStatus
|
||||
uint16_t battery_dcdcHvBusVolt = 0; // Change name from battery_high_voltage to battery_dcdcHvBusVolt
|
||||
uint16_t battery_dcdcLvBusVolt = 0; // Change name from battery_low_voltage to battery_dcdcLvBusVolt
|
||||
|
@ -554,7 +554,7 @@ class TeslaBattery : public CanBattery {
|
|||
uint8_t battery_packContNegativeState = 0;
|
||||
uint8_t battery_packContPositiveState = 0;
|
||||
uint8_t battery_packContactorSetState = 0;
|
||||
bool battery_packCtrsClosingAllowed = false; // Change to bool
|
||||
bool battery_packCtrsClosingBlocked = false; // Change to bool
|
||||
bool battery_pyroTestInProgress = false; // Change to bool
|
||||
bool battery_packCtrsOpenNowRequested = false; // Change to bool
|
||||
bool battery_packCtrsOpenRequested = false; // Change to bool
|
||||
|
@ -596,45 +596,45 @@ class TeslaBattery : public CanBattery {
|
|||
uint8_t BMS_info_bootUdsProtoVersion = 0;
|
||||
uint32_t BMS_info_bootCrc = 0;
|
||||
//0x212: 530 BMS_status
|
||||
bool battery_BMS_hvacPowerRequest = false; //Change to bool
|
||||
bool battery_BMS_notEnoughPowerForDrive = false; //Change to bool
|
||||
bool battery_BMS_notEnoughPowerForSupport = false; //Change to bool
|
||||
bool battery_BMS_preconditionAllowed = false; //Change to bool
|
||||
bool battery_BMS_updateAllowed = false; //Change to bool
|
||||
bool battery_BMS_activeHeatingWorthwhile = false; //Change to bool
|
||||
bool battery_BMS_cpMiaOnHvs = false; //Change to bool
|
||||
uint8_t battery_BMS_contactorState = 0;
|
||||
uint8_t battery_BMS_state = 0;
|
||||
uint8_t battery_BMS_hvState = 0;
|
||||
uint16_t battery_BMS_isolationResistance = 0;
|
||||
bool battery_BMS_chargeRequest = false; //Change to bool
|
||||
bool battery_BMS_keepWarmRequest = false; //Change to bool
|
||||
uint8_t battery_BMS_uiChargeStatus = 0;
|
||||
bool battery_BMS_diLimpRequest = false; //Change to bool
|
||||
bool battery_BMS_okToShipByAir = false; //Change to bool
|
||||
bool battery_BMS_okToShipByLand = false; //Change to bool
|
||||
uint32_t battery_BMS_chgPowerAvailable = 0;
|
||||
uint8_t battery_BMS_chargeRetryCount = 0;
|
||||
bool battery_BMS_pcsPwmEnabled = false; //Change to bool
|
||||
bool battery_BMS_ecuLogUploadRequest = false; //Change to bool
|
||||
uint8_t battery_BMS_minPackTemperature = 0;
|
||||
bool BMS_hvacPowerRequest = false; //Change to bool
|
||||
bool BMS_notEnoughPowerForDrive = false; //Change to bool
|
||||
bool BMS_notEnoughPowerForSupport = false; //Change to bool
|
||||
bool BMS_preconditionAllowed = false; //Change to bool
|
||||
bool BMS_updateAllowed = false; //Change to bool
|
||||
bool BMS_activeHeatingWorthwhile = false; //Change to bool
|
||||
bool BMS_cpMiaOnHvs = false; //Change to bool
|
||||
uint8_t BMS_contactorState = 0;
|
||||
uint8_t BMS_state = 0;
|
||||
uint8_t BMS_hvState = 0;
|
||||
uint16_t BMS_isolationResistance = 0;
|
||||
bool BMS_chargeRequest = false; //Change to bool
|
||||
bool BMS_keepWarmRequest = false; //Change to bool
|
||||
uint8_t BMS_uiChargeStatus = 0;
|
||||
bool BMS_diLimpRequest = false; //Change to bool
|
||||
bool BMS_okToShipByAir = false; //Change to bool
|
||||
bool BMS_okToShipByLand = false; //Change to bool
|
||||
uint32_t BMS_chgPowerAvailable = 0;
|
||||
uint8_t BMS_chargeRetryCount = 0;
|
||||
bool BMS_pcsPwmEnabled = false; //Change to bool
|
||||
bool BMS_ecuLogUploadRequest = false; //Change to bool
|
||||
uint8_t BMS_minPackTemperature = 0;
|
||||
// 0x224:548 PCS_dcdcStatus
|
||||
uint8_t battery_PCS_dcdcPrechargeStatus = 0;
|
||||
uint8_t battery_PCS_dcdc12VSupportStatus = 0;
|
||||
uint8_t battery_PCS_dcdcHvBusDischargeStatus = 0;
|
||||
uint16_t battery_PCS_dcdcMainState = 0;
|
||||
uint8_t battery_PCS_dcdcSubState = 0;
|
||||
bool battery_PCS_dcdcFaulted = false; //Change to bool
|
||||
bool battery_PCS_dcdcOutputIsLimited = false; //Change to bool
|
||||
uint32_t battery_PCS_dcdcMaxOutputCurrentAllowed = 0;
|
||||
uint8_t battery_PCS_dcdcPrechargeRtyCnt = 0;
|
||||
uint8_t battery_PCS_dcdc12VSupportRtyCnt = 0;
|
||||
uint8_t battery_PCS_dcdcDischargeRtyCnt = 0;
|
||||
uint8_t battery_PCS_dcdcPwmEnableLine = 0;
|
||||
uint8_t battery_PCS_dcdcSupportingFixedLvTarget = 0;
|
||||
uint8_t battery_PCS_ecuLogUploadRequest = 0;
|
||||
uint8_t battery_PCS_dcdcPrechargeRestartCnt = 0;
|
||||
uint8_t battery_PCS_dcdcInitialPrechargeSubState = 0;
|
||||
uint8_t PCS_dcdcPrechargeStatus = 0;
|
||||
uint8_t PCS_dcdc12VSupportStatus = 0;
|
||||
uint8_t PCS_dcdcHvBusDischargeStatus = 0;
|
||||
uint16_t PCS_dcdcMainState = 0;
|
||||
uint8_t PCS_dcdcSubState = 0;
|
||||
bool PCS_dcdcFaulted = false; //Change to bool
|
||||
bool PCS_dcdcOutputIsLimited = false; //Change to bool
|
||||
uint32_t PCS_dcdcMaxOutputCurrentAllowed = 0;
|
||||
uint8_t PCS_dcdcPrechargeRtyCnt = 0;
|
||||
uint8_t PCS_dcdc12VSupportRtyCnt = 0;
|
||||
uint8_t PCS_dcdcDischargeRtyCnt = 0;
|
||||
uint8_t PCS_dcdcPwmEnableLine = 0;
|
||||
uint8_t PCS_dcdcSupportingFixedLvTarget = 0;
|
||||
uint8_t PCS_ecuLogUploadRequest = 0;
|
||||
uint8_t PCS_dcdcPrechargeRestartCnt = 0;
|
||||
uint8_t PCS_dcdcInitialPrechargeSubState = 0;
|
||||
//0x312: 786 BMS_thermalStatus
|
||||
uint16_t BMS_powerDissipation = 0;
|
||||
uint16_t BMS_flowRequest = 0;
|
||||
|
@ -816,99 +816,99 @@ class TeslaBattery : public CanBattery {
|
|||
bool battery_fcCtrCloseFailed = false;
|
||||
bool battery_shuntThermistorMia = false;
|
||||
//0x320: 800 BMS_alertMatrix
|
||||
uint8_t battery_BMS_matrixIndex = 0; // Changed to bool
|
||||
bool battery_BMS_a061_robinBrickOverVoltage = false;
|
||||
bool battery_BMS_a062_SW_BrickV_Imbalance = false;
|
||||
bool battery_BMS_a063_SW_ChargePort_Fault = false;
|
||||
bool battery_BMS_a064_SW_SOC_Imbalance = false;
|
||||
bool battery_BMS_a127_SW_shunt_SNA = false;
|
||||
bool battery_BMS_a128_SW_shunt_MIA = false;
|
||||
bool battery_BMS_a069_SW_Low_Power = false;
|
||||
bool battery_BMS_a130_IO_CAN_Error = false;
|
||||
bool battery_BMS_a071_SW_SM_TransCon_Not_Met = false;
|
||||
bool battery_BMS_a132_HW_BMB_OTP_Uncorrctbl = false;
|
||||
bool battery_BMS_a134_SW_Delayed_Ctr_Off = false;
|
||||
bool battery_BMS_a075_SW_Chg_Disable_Failure = false;
|
||||
bool battery_BMS_a076_SW_Dch_While_Charging = false;
|
||||
bool battery_BMS_a017_SW_Brick_OV = false;
|
||||
bool battery_BMS_a018_SW_Brick_UV = false;
|
||||
bool battery_BMS_a019_SW_Module_OT = false;
|
||||
bool battery_BMS_a021_SW_Dr_Limits_Regulation = false;
|
||||
bool battery_BMS_a022_SW_Over_Current = false;
|
||||
bool battery_BMS_a023_SW_Stack_OV = false;
|
||||
bool battery_BMS_a024_SW_Islanded_Brick = false;
|
||||
bool battery_BMS_a025_SW_PwrBalance_Anomaly = false;
|
||||
bool battery_BMS_a026_SW_HFCurrent_Anomaly = false;
|
||||
bool battery_BMS_a087_SW_Feim_Test_Blocked = false;
|
||||
bool battery_BMS_a088_SW_VcFront_MIA_InDrive = false;
|
||||
bool battery_BMS_a089_SW_VcFront_MIA = false;
|
||||
bool battery_BMS_a090_SW_Gateway_MIA = false;
|
||||
bool battery_BMS_a091_SW_ChargePort_MIA = false;
|
||||
bool battery_BMS_a092_SW_ChargePort_Mia_On_Hv = false;
|
||||
bool battery_BMS_a034_SW_Passive_Isolation = false;
|
||||
bool battery_BMS_a035_SW_Isolation = false;
|
||||
bool battery_BMS_a036_SW_HvpHvilFault = false;
|
||||
bool battery_BMS_a037_SW_Flood_Port_Open = false;
|
||||
bool battery_BMS_a158_SW_HVP_HVI_Comms = false;
|
||||
bool battery_BMS_a039_SW_DC_Link_Over_Voltage = false;
|
||||
bool battery_BMS_a041_SW_Power_On_Reset = false;
|
||||
bool battery_BMS_a042_SW_MPU_Error = false;
|
||||
bool battery_BMS_a043_SW_Watch_Dog_Reset = false;
|
||||
bool battery_BMS_a044_SW_Assertion = false;
|
||||
bool battery_BMS_a045_SW_Exception = false;
|
||||
bool battery_BMS_a046_SW_Task_Stack_Usage = false;
|
||||
bool battery_BMS_a047_SW_Task_Stack_Overflow = false;
|
||||
bool battery_BMS_a048_SW_Log_Upload_Request = false;
|
||||
bool battery_BMS_a169_SW_FC_Pack_Weld = false;
|
||||
bool battery_BMS_a050_SW_Brick_Voltage_MIA = false;
|
||||
bool battery_BMS_a051_SW_HVC_Vref_Bad = false;
|
||||
bool battery_BMS_a052_SW_PCS_MIA = false;
|
||||
bool battery_BMS_a053_SW_ThermalModel_Sanity = false;
|
||||
bool battery_BMS_a054_SW_Ver_Supply_Fault = false;
|
||||
bool battery_BMS_a176_SW_GracefulPowerOff = false;
|
||||
bool battery_BMS_a059_SW_Pack_Voltage_Sensing = false;
|
||||
bool battery_BMS_a060_SW_Leakage_Test_Failure = false;
|
||||
bool battery_BMS_a077_SW_Charger_Regulation = false;
|
||||
bool battery_BMS_a081_SW_Ctr_Close_Blocked = false;
|
||||
bool battery_BMS_a082_SW_Ctr_Force_Open = false;
|
||||
bool battery_BMS_a083_SW_Ctr_Close_Failure = false;
|
||||
bool battery_BMS_a084_SW_Sleep_Wake_Aborted = false;
|
||||
bool battery_BMS_a094_SW_Drive_Inverter_MIA = false;
|
||||
bool battery_BMS_a099_SW_BMB_Communication = false;
|
||||
bool battery_BMS_a105_SW_One_Module_Tsense = false;
|
||||
bool battery_BMS_a106_SW_All_Module_Tsense = false;
|
||||
bool battery_BMS_a107_SW_Stack_Voltage_MIA = false;
|
||||
bool battery_BMS_a121_SW_NVRAM_Config_Error = false;
|
||||
bool battery_BMS_a122_SW_BMS_Therm_Irrational = false;
|
||||
bool battery_BMS_a123_SW_Internal_Isolation = false;
|
||||
bool battery_BMS_a129_SW_VSH_Failure = false;
|
||||
bool battery_BMS_a131_Bleed_FET_Failure = false;
|
||||
bool battery_BMS_a136_SW_Module_OT_Warning = false;
|
||||
bool battery_BMS_a137_SW_Brick_UV_Warning = false;
|
||||
bool battery_BMS_a138_SW_Brick_OV_Warning = false;
|
||||
bool battery_BMS_a139_SW_DC_Link_V_Irrational = false;
|
||||
bool battery_BMS_a141_SW_BMB_Status_Warning = false;
|
||||
bool battery_BMS_a144_Hvp_Config_Mismatch = false;
|
||||
bool battery_BMS_a145_SW_SOC_Change = false;
|
||||
bool battery_BMS_a146_SW_Brick_Overdischarged = false;
|
||||
bool battery_BMS_a149_SW_Missing_Config_Block = false;
|
||||
bool battery_BMS_a151_SW_external_isolation = false;
|
||||
bool battery_BMS_a156_SW_BMB_Vref_bad = false;
|
||||
bool battery_BMS_a157_SW_HVP_HVS_Comms = false;
|
||||
bool battery_BMS_a159_SW_HVP_ECU_Error = false;
|
||||
bool battery_BMS_a161_SW_DI_Open_Request = false;
|
||||
bool battery_BMS_a162_SW_No_Power_For_Support = false;
|
||||
bool battery_BMS_a163_SW_Contactor_Mismatch = false;
|
||||
bool battery_BMS_a164_SW_Uncontrolled_Regen = false;
|
||||
bool battery_BMS_a165_SW_Pack_Partial_Weld = false;
|
||||
bool battery_BMS_a166_SW_Pack_Full_Weld = false;
|
||||
bool battery_BMS_a167_SW_FC_Partial_Weld = false;
|
||||
bool battery_BMS_a168_SW_FC_Full_Weld = false;
|
||||
bool battery_BMS_a170_SW_Limp_Mode = false;
|
||||
bool battery_BMS_a171_SW_Stack_Voltage_Sense = false;
|
||||
bool battery_BMS_a174_SW_Charge_Failure = false;
|
||||
bool battery_BMS_a179_SW_Hvp_12V_Fault = false;
|
||||
bool battery_BMS_a180_SW_ECU_reset_blocked = false;
|
||||
uint8_t BMS_matrixIndex = 0; // Changed to bool
|
||||
bool BMS_a061_robinBrickOverVoltage = false;
|
||||
bool BMS_a062_SW_BrickV_Imbalance = false;
|
||||
bool BMS_a063_SW_ChargePort_Fault = false;
|
||||
bool BMS_a064_SW_SOC_Imbalance = false;
|
||||
bool BMS_a127_SW_shunt_SNA = false;
|
||||
bool BMS_a128_SW_shunt_MIA = false;
|
||||
bool BMS_a069_SW_Low_Power = false;
|
||||
bool BMS_a130_IO_CAN_Error = false;
|
||||
bool BMS_a071_SW_SM_TransCon_Not_Met = false;
|
||||
bool BMS_a132_HW_BMB_OTP_Uncorrctbl = false;
|
||||
bool BMS_a134_SW_Delayed_Ctr_Off = false;
|
||||
bool BMS_a075_SW_Chg_Disable_Failure = false;
|
||||
bool BMS_a076_SW_Dch_While_Charging = false;
|
||||
bool BMS_a017_SW_Brick_OV = false;
|
||||
bool BMS_a018_SW_Brick_UV = false;
|
||||
bool BMS_a019_SW_Module_OT = false;
|
||||
bool BMS_a021_SW_Dr_Limits_Regulation = false;
|
||||
bool BMS_a022_SW_Over_Current = false;
|
||||
bool BMS_a023_SW_Stack_OV = false;
|
||||
bool BMS_a024_SW_Islanded_Brick = false;
|
||||
bool BMS_a025_SW_PwrBalance_Anomaly = false;
|
||||
bool BMS_a026_SW_HFCurrent_Anomaly = false;
|
||||
bool BMS_a087_SW_Feim_Test_Blocked = false;
|
||||
bool BMS_a088_SW_VcFront_MIA_InDrive = false;
|
||||
bool BMS_a089_SW_VcFront_MIA = false;
|
||||
bool BMS_a090_SW_Gateway_MIA = false;
|
||||
bool BMS_a091_SW_ChargePort_MIA = false;
|
||||
bool BMS_a092_SW_ChargePort_Mia_On_Hv = false;
|
||||
bool BMS_a034_SW_Passive_Isolation = false;
|
||||
bool BMS_a035_SW_Isolation = false;
|
||||
bool BMS_a036_SW_HvpHvilFault = false;
|
||||
bool BMS_a037_SW_Flood_Port_Open = false;
|
||||
bool BMS_a158_SW_HVP_HVI_Comms = false;
|
||||
bool BMS_a039_SW_DC_Link_Over_Voltage = false;
|
||||
bool BMS_a041_SW_Power_On_Reset = false;
|
||||
bool BMS_a042_SW_MPU_Error = false;
|
||||
bool BMS_a043_SW_Watch_Dog_Reset = false;
|
||||
bool BMS_a044_SW_Assertion = false;
|
||||
bool BMS_a045_SW_Exception = false;
|
||||
bool BMS_a046_SW_Task_Stack_Usage = false;
|
||||
bool BMS_a047_SW_Task_Stack_Overflow = false;
|
||||
bool BMS_a048_SW_Log_Upload_Request = false;
|
||||
bool BMS_a169_SW_FC_Pack_Weld = false;
|
||||
bool BMS_a050_SW_Brick_Voltage_MIA = false;
|
||||
bool BMS_a051_SW_HVC_Vref_Bad = false;
|
||||
bool BMS_a052_SW_PCS_MIA = false;
|
||||
bool BMS_a053_SW_ThermalModel_Sanity = false;
|
||||
bool BMS_a054_SW_Ver_Supply_Fault = false;
|
||||
bool BMS_a176_SW_GracefulPowerOff = false;
|
||||
bool BMS_a059_SW_Pack_Voltage_Sensing = false;
|
||||
bool BMS_a060_SW_Leakage_Test_Failure = false;
|
||||
bool BMS_a077_SW_Charger_Regulation = false;
|
||||
bool BMS_a081_SW_Ctr_Close_Blocked = false;
|
||||
bool BMS_a082_SW_Ctr_Force_Open = false;
|
||||
bool BMS_a083_SW_Ctr_Close_Failure = false;
|
||||
bool BMS_a084_SW_Sleep_Wake_Aborted = false;
|
||||
bool BMS_a094_SW_Drive_Inverter_MIA = false;
|
||||
bool BMS_a099_SW_BMB_Communication = false;
|
||||
bool BMS_a105_SW_One_Module_Tsense = false;
|
||||
bool BMS_a106_SW_All_Module_Tsense = false;
|
||||
bool BMS_a107_SW_Stack_Voltage_MIA = false;
|
||||
bool BMS_a121_SW_NVRAM_Config_Error = false;
|
||||
bool BMS_a122_SW_BMS_Therm_Irrational = false;
|
||||
bool BMS_a123_SW_Internal_Isolation = false;
|
||||
bool BMS_a129_SW_VSH_Failure = false;
|
||||
bool BMS_a131_Bleed_FET_Failure = false;
|
||||
bool BMS_a136_SW_Module_OT_Warning = false;
|
||||
bool BMS_a137_SW_Brick_UV_Warning = false;
|
||||
bool BMS_a138_SW_Brick_OV_Warning = false;
|
||||
bool BMS_a139_SW_DC_Link_V_Irrational = false;
|
||||
bool BMS_a141_SW_BMB_Status_Warning = false;
|
||||
bool BMS_a144_Hvp_Config_Mismatch = false;
|
||||
bool BMS_a145_SW_SOC_Change = false;
|
||||
bool BMS_a146_SW_Brick_Overdischarged = false;
|
||||
bool BMS_a149_SW_Missing_Config_Block = false;
|
||||
bool BMS_a151_SW_external_isolation = false;
|
||||
bool BMS_a156_SW_BMB_Vref_bad = false;
|
||||
bool BMS_a157_SW_HVP_HVS_Comms = false;
|
||||
bool BMS_a159_SW_HVP_ECU_Error = false;
|
||||
bool BMS_a161_SW_DI_Open_Request = false;
|
||||
bool BMS_a162_SW_No_Power_For_Support = false;
|
||||
bool BMS_a163_SW_Contactor_Mismatch = false;
|
||||
bool BMS_a164_SW_Uncontrolled_Regen = false;
|
||||
bool BMS_a165_SW_Pack_Partial_Weld = false;
|
||||
bool BMS_a166_SW_Pack_Full_Weld = false;
|
||||
bool BMS_a167_SW_FC_Partial_Weld = false;
|
||||
bool BMS_a168_SW_FC_Full_Weld = false;
|
||||
bool BMS_a170_SW_Limp_Mode = false;
|
||||
bool BMS_a171_SW_Stack_Voltage_Sense = false;
|
||||
bool BMS_a174_SW_Charge_Failure = false;
|
||||
bool BMS_a179_SW_Hvp_12V_Fault = false;
|
||||
bool BMS_a180_SW_ECU_reset_blocked = false;
|
||||
};
|
||||
|
||||
class TeslaModel3YBattery : public TeslaBattery {
|
||||
|
|
|
@ -39,8 +39,8 @@ class TeslaHtmlRenderer : public BatteryHtmlRenderer {
|
|||
float packMass = static_cast<float>(datalayer_extended.tesla.battery_packMass);
|
||||
float platformMaxBusVoltage =
|
||||
static_cast<float>(datalayer_extended.tesla.battery_platformMaxBusVoltage) * 0.1 + 375;
|
||||
float bms_min_voltage = static_cast<float>(datalayer_extended.tesla.battery_bms_min_voltage) * 0.01 * 2;
|
||||
float bms_max_voltage = static_cast<float>(datalayer_extended.tesla.battery_bms_max_voltage) * 0.01 * 2;
|
||||
float bms_min_voltage = static_cast<float>(datalayer_extended.tesla.BMS_min_voltage) * 0.01 * 2;
|
||||
float bms_max_voltage = static_cast<float>(datalayer_extended.tesla.BMS_max_voltage) * 0.01 * 2;
|
||||
float max_charge_current = static_cast<float>(datalayer_extended.tesla.battery_max_charge_current);
|
||||
float max_discharge_current = static_cast<float>(datalayer_extended.tesla.battery_max_discharge_current);
|
||||
float soc_ave = static_cast<float>(datalayer_extended.tesla.battery_soc_ave) * 0.1;
|
||||
|
@ -51,9 +51,9 @@ class TeslaHtmlRenderer : public BatteryHtmlRenderer {
|
|||
float BrickVoltageMin = static_cast<float>(datalayer_extended.tesla.battery_BrickVoltageMin) * 0.002;
|
||||
float BrickModelTMax = static_cast<float>(datalayer_extended.tesla.battery_BrickModelTMax) * 0.5 - 40;
|
||||
float BrickModelTMin = static_cast<float>(datalayer_extended.tesla.battery_BrickModelTMin) * 0.5 - 40;
|
||||
float isolationResistance = static_cast<float>(datalayer_extended.tesla.battery_BMS_isolationResistance) * 10;
|
||||
float isolationResistance = static_cast<float>(datalayer_extended.tesla.BMS_isolationResistance) * 10;
|
||||
float PCS_dcdcMaxOutputCurrentAllowed =
|
||||
static_cast<float>(datalayer_extended.tesla.battery_PCS_dcdcMaxOutputCurrentAllowed) * 0.1;
|
||||
static_cast<float>(datalayer_extended.tesla.PCS_dcdcMaxOutputCurrentAllowed) * 0.1;
|
||||
float PCS_dcdcTemp = static_cast<float>(datalayer_extended.tesla.PCS_dcdcTemp) * 0.1 + 40;
|
||||
float PCS_ambientTemp = static_cast<float>(datalayer_extended.tesla.PCS_ambientTemp) * 0.1 + 40;
|
||||
float PCS_chgPhATemp = static_cast<float>(datalayer_extended.tesla.PCS_chgPhATemp) * 0.1 + 40;
|
||||
|
@ -128,7 +128,7 @@ class TeslaHtmlRenderer : public BatteryHtmlRenderer {
|
|||
static const char* contactorText[] = {"UNKNOWN(0)", "OPEN", "CLOSING", "BLOCKED", "OPENING",
|
||||
"CLOSED", "UNKNOWN(6)", "WELDED", "POS_CL", "NEG_CL",
|
||||
"UNKNOWN(10)", "UNKNOWN(11)", "UNKNOWN(12)"};
|
||||
static const char* hvilStatusState[] = {"NOT Ok",
|
||||
static const char* hvilStatusState[] = {"UNKNOWN or CONTACTORS OPEN",
|
||||
"STATUS_OK",
|
||||
"CURRENT_SOURCE_FAULT",
|
||||
"INTERNAL_OPEN_FAULT",
|
||||
|
@ -183,15 +183,49 @@ class TeslaHtmlRenderer : public BatteryHtmlRenderer {
|
|||
static const char* noYes[] = {"No", "Yes"};
|
||||
static const char* Fault[] = {"NOT_ACTIVE", "ACTIVE"};
|
||||
|
||||
//0x20A 522 HVP_contatorState
|
||||
content += "<h4>Contactor Status: " + String(contactorText[datalayer_extended.tesla.status_contactor]) + "</h4>";
|
||||
content += "<h4>HVIL: " + String(hvilStatusState[datalayer_extended.tesla.hvil_status]) + "</h4>";
|
||||
//Buttons for user action
|
||||
content += "<button onclick='askTeslaClearIsolation()'>Clear isolation fault</button>";
|
||||
content += "<button onclick='askTeslaResetBMS()'>BMS reset</button>";
|
||||
//Main battery info
|
||||
char readableBatterySerialNumber[15]; // One extra space for null terminator
|
||||
memcpy(readableBatterySerialNumber, datalayer_extended.tesla.battery_serialNumber,
|
||||
sizeof(datalayer_extended.tesla.battery_serialNumber));
|
||||
readableBatterySerialNumber[14] = '\0'; // Null terminate the string
|
||||
content += "<h4>Battery Serial Number: " + String(readableBatterySerialNumber) + "</h4>";
|
||||
char readableBatteryPartNumber[13]; // One extra space for null terminator
|
||||
memcpy(readableBatteryPartNumber, datalayer_extended.tesla.battery_partNumber,
|
||||
sizeof(datalayer_extended.tesla.battery_partNumber));
|
||||
readableBatteryPartNumber[12] = '\0'; // Null terminate the string
|
||||
content += "<h4>Battery Part Number: " + String(readableBatteryPartNumber) + "</h4>";
|
||||
//0x3C4 PCS_info
|
||||
char readablePCSPartNumber[13]; // One extra space for null terminator
|
||||
memcpy(readablePCSPartNumber, datalayer_extended.tesla.PCS_partNumber,
|
||||
sizeof(datalayer_extended.tesla.PCS_partNumber));
|
||||
readablePCSPartNumber[13] = '\0'; // Null terminate the string
|
||||
content += "<h4>PCS Part Number: " + String(readablePCSPartNumber) + "</h4>";
|
||||
content += "<h4>Battery Manufacture Date: " + String(datalayer_extended.tesla.battery_manufactureDate) + "</h4>";
|
||||
content += "<h4>Battery Pack Mass: " + String(packMass) + " KG</h4>";
|
||||
//0x3D2 978 BMS_kwhCounter
|
||||
content += "<h4>Battery Total Discharge: " + String(total_discharge) + " kWh</h4>";
|
||||
content += "<h4>Battery Total Charge: " + String(total_charge) + " kWh</h4>";
|
||||
//0x20A 522 HVP_contactorState + HVIL
|
||||
//content += "<h4>HVIL Fault: " + String(noYes[datalayer_extended.tesla.BMS_hvilFault]) + "</h4>";
|
||||
content += "<h4>HVIL Status: " + String(hvilStatusState[datalayer_extended.tesla.hvil_status]) + "</h4>";
|
||||
content +=
|
||||
"<h4>Negative contactor: " + String(contactorState[datalayer_extended.tesla.packContNegativeState]) + "</h4>";
|
||||
"<h4>HVP Contactor State: " + String(contactorText[datalayer_extended.tesla.packContactorSetState]) + "</h4>";
|
||||
content +=
|
||||
"<h4>Positive contactor: " + String(contactorState[datalayer_extended.tesla.packContPositiveState]) + "</h4>";
|
||||
content += "<h4>Closing allowed?: " + String(noYes[datalayer_extended.tesla.packCtrsClosingAllowed]) + "</h4>";
|
||||
content += "<h4>Pyrotest in Progress: " + String(noYes[datalayer_extended.tesla.pyroTestInProgress]) + "</h4>";
|
||||
"<h4>BMS Contactor State: " + String(BMS_contactorState[datalayer_extended.tesla.BMS_contactorState]) + "</h4>";
|
||||
content +=
|
||||
"<h4>Negative Contactor: " + String(contactorState[datalayer_extended.tesla.packContNegativeState]) + "</h4>";
|
||||
content +=
|
||||
"<h4>Positive Contactor: " + String(contactorState[datalayer_extended.tesla.packContPositiveState]) + "</h4>";
|
||||
if (datalayer_extended.tesla.packContactorSetState == 5) { //Closed
|
||||
content += "<h4>Closing blocked: " + String(noYes[datalayer_extended.tesla.packCtrsClosingBlocked]) +
|
||||
" (already CLOSED)</h4>";
|
||||
} else {
|
||||
content += "<h4>Closing blocked: " + String(noYes[datalayer_extended.tesla.packCtrsClosingBlocked]) + "</h4>";
|
||||
}
|
||||
content += "<h4>Pyrotest in progress: " + String(noYes[datalayer_extended.tesla.pyroTestInProgress]) + "</h4>";
|
||||
content += "<h4>Contactors Open Now Requested: " +
|
||||
String(noYes[datalayer_extended.tesla.battery_packCtrsOpenNowRequested]) + "</h4>";
|
||||
content +=
|
||||
|
@ -204,21 +238,16 @@ class TeslaHtmlRenderer : public BatteryHtmlRenderer {
|
|||
content +=
|
||||
"<h4>DC Link Allowed to Energize: " + String(noYes[datalayer_extended.tesla.battery_dcLinkAllowedToEnergize]) +
|
||||
"</h4>";
|
||||
char readableSerialNumber[15]; // One extra space for null terminator
|
||||
memcpy(readableSerialNumber, datalayer_extended.tesla.BMS_SerialNumber,
|
||||
sizeof(datalayer_extended.tesla.BMS_SerialNumber));
|
||||
readableSerialNumber[14] = '\0'; // Null terminate the string
|
||||
content += "<h4>BMS Serial number: " + String(readableSerialNumber) + "</h4>";
|
||||
// Comment what data you would like to display, order can be changed.
|
||||
//0x352 850 BMS_energyStatus
|
||||
if (datalayer_extended.tesla.BMS352_mux == false) {
|
||||
content += "<h3>BMS 0x352 w/o mux</h3>"; //if using older BMS <2021 and comment 0x352 without MUX
|
||||
content += "<h4>Calculated SOH: " + String(nominal_full_pack_energy * 100 / beginning_of_life) + "</h4>";
|
||||
content += "<h4>Nominal Full Pack Energy: " + String(nominal_full_pack_energy) + " KWh</h4>";
|
||||
content += "<h4>Nominal Energy Remaining: " + String(nominal_energy_remaining) + " KWh</h4>";
|
||||
content += "<h4>Ideal Energy Remaining: " + String(ideal_energy_remaining) + " KWh</h4>";
|
||||
content += "<h4>Energy to Charge Complete: " + String(energy_to_charge_complete) + " KWh</h4>";
|
||||
content += "<h4>Energy Buffer: " + String(energy_buffer) + " KWh</h4>";
|
||||
content += "<h4>Nominal Full Pack Energy: " + String(nominal_full_pack_energy) + " kWh</h4>";
|
||||
content += "<h4>Nominal Energy Remaining: " + String(nominal_energy_remaining) + " kWh</h4>";
|
||||
content += "<h4>Ideal Energy Remaining: " + String(ideal_energy_remaining) + " kWh</h4>";
|
||||
content += "<h4>Energy to Charge Complete: " + String(energy_to_charge_complete) + " kWh</h4>";
|
||||
content += "<h4>Energy Buffer: " + String(energy_buffer) + " kWh</h4>";
|
||||
content += "<h4>Full Charge Complete: " + String(noYes[datalayer_extended.tesla.battery_full_charge_complete]) +
|
||||
"</h4>"; //bool
|
||||
}
|
||||
|
@ -226,19 +255,26 @@ class TeslaHtmlRenderer : public BatteryHtmlRenderer {
|
|||
if (datalayer_extended.tesla.BMS352_mux == true) {
|
||||
content += "<h3>BMS 0x352 w/ mux</h3>"; //if using newer BMS >2021 and comment 0x352 with MUX
|
||||
content += "<h4>Calculated SOH: " + String(nominal_full_pack_energy_m0 * 100 / beginning_of_life) + "</h4>";
|
||||
content += "<h4>Nominal Full Pack Energy: " + String(nominal_full_pack_energy_m0) + " KWh</h4>";
|
||||
content += "<h4>Nominal Energy Remaining: " + String(nominal_energy_remaining_m0) + " KWh</h4>";
|
||||
content += "<h4>Ideal Energy Remaining: " + String(ideal_energy_remaining_m0) + " KWh</h4>";
|
||||
content += "<h4>Energy to Charge Complete: " + String(energy_to_charge_complete_m1) + " KWh</h4>";
|
||||
content += "<h4>Energy Buffer: " + String(energy_buffer_m1) + " KWh</h4>";
|
||||
content += "<h4>Expected Energy Remaining: " + String(expected_energy_remaining_m1) + " KWh</h4>";
|
||||
content += "<h4>Nominal Full Pack Energy: " + String(nominal_full_pack_energy_m0) + " kWh</h4>";
|
||||
content += "<h4>Nominal Energy Remaining: " + String(nominal_energy_remaining_m0) + " kWh</h4>";
|
||||
content += "<h4>Ideal Energy Remaining: " + String(ideal_energy_remaining_m0) + " kWh</h4>";
|
||||
content += "<h4>Energy to Charge Complete: " + String(energy_to_charge_complete_m1) + " kWh</h4>";
|
||||
content += "<h4>Energy Buffer: " + String(energy_buffer_m1) + " kWh</h4>";
|
||||
content += "<h4>Expected Energy Remaining: " + String(expected_energy_remaining_m1) + " kWh</h4>";
|
||||
content += "<h4>Fully Charged: " + String(noYes[datalayer_extended.tesla.battery_fully_charged]) + "</h4>";
|
||||
}
|
||||
//0x3D2 978 BMS_kwhCounter
|
||||
content += "<h4>Total Discharge: " + String(total_discharge) + " KWh</h4>";
|
||||
content += "<h4>Total Charge: " + String(total_charge) + " KWh</h4>";
|
||||
//0x212 530 BMS_status
|
||||
content += "<h4>Isolation Resistance: " + String(isolationResistance) + " kOhms</h4>";
|
||||
content += "<h4>BMS State: " + String(BMS_state[datalayer_extended.tesla.BMS_state]) + "</h4>";
|
||||
content += "<h4>BMS HV State: " + String(BMS_hvState[datalayer_extended.tesla.BMS_hvState]) + "</h4>";
|
||||
content += "<h4>BMS UI Charge Status: " + String(BMS_uiChargeStatus[datalayer_extended.tesla.BMS_uiChargeStatus]) +
|
||||
"</h4>";
|
||||
content += "<h4>BMS_buildConfigId: " + String(datalayer_extended.tesla.BMS_info_buildConfigId) + "</h4>";
|
||||
content += "<h4>BMS_hardwareId: " + String(datalayer_extended.tesla.BMS_info_hardwareId) + "</h4>";
|
||||
content += "<h4>BMS_componentId: " + String(datalayer_extended.tesla.BMS_info_componentId) + "</h4>";
|
||||
content += "<h4>BMS PCS PWM Enabled: " + String(Fault[datalayer_extended.tesla.BMS_pcsPwmEnabled]) + "</h4>";
|
||||
//0x292 658 BMS_socStates
|
||||
content += "<h4>Battery Beginning of Life: " + String(beginning_of_life) + " KWh</h4>";
|
||||
content += "<h4>Battery Beginning of Life: " + String(beginning_of_life) + " kWh</h4>";
|
||||
content += "<h4>Battery SOC UI: " + String(soc_ui) + " </h4>";
|
||||
content += "<h4>Battery SOC Ave: " + String(soc_ave) + " </h4>";
|
||||
content += "<h4>Battery SOC Max: " + String(soc_max) + " </h4>";
|
||||
|
@ -252,7 +288,7 @@ class TeslaHtmlRenderer : public BatteryHtmlRenderer {
|
|||
//content += "<h4>packConfigMultiplexer: " + String(datalayer_extended.tesla.battery_packConfigMultiplexer) + "</h4>"; // Not giving useable data
|
||||
//content += "<h4>moduleType: " + String(datalayer_extended.tesla.battery_moduleType) + "</h4>"; // Not giving useable data
|
||||
//content += "<h4>reserveConfig: " + String(datalayer_extended.tesla.battery_reservedConfig) + "</h4>"; // Not giving useable data
|
||||
content += "<h4>Battery Pack Mass: " + String(packMass) + " KG</h4>";
|
||||
//content += "<h4>Battery Pack Mass: " + String(packMass) + " KG</h4>";
|
||||
content += "<h4>Platform Max Bus Voltage: " + String(platformMaxBusVoltage) + " V</h4>";
|
||||
//0x2D2 722 BMSVAlimits
|
||||
content += "<h4>BMS Min Voltage: " + String(bms_min_voltage) + " V</h4>";
|
||||
|
@ -273,25 +309,14 @@ class TeslaHtmlRenderer : public BatteryHtmlRenderer {
|
|||
content += "<h4>PCS Chg PhB Temp: " + String(PCS_chgPhBTemp) + " DegC</h4>";
|
||||
content += "<h4>PCS Chg PhC Temp: " + String(PCS_chgPhCTemp) + " DegC</h4>";
|
||||
//0x252 594 BMS_powerAvailable
|
||||
content += "<h4>Max Regen Power: " + String(BMS_maxRegenPower) + " KW</h4>";
|
||||
content += "<h4>Max Discharge Power: " + String(BMS_maxDischargePower) + " KW</h4>";
|
||||
//content += "<h4>Max Stationary Heat Power: " + String(BMS_maxStationaryHeatPower) + " KWh</h4>"; // Not giving useable data
|
||||
//content += "<h4>HVAC Power Budget: " + String(BMS_hvacPowerBudget) + " KW</h4>"; // Not giving useable data
|
||||
content += "<h4>Max Regen Power: " + String(BMS_maxRegenPower) + " kW</h4>";
|
||||
content += "<h4>Max Discharge Power: " + String(BMS_maxDischargePower) + " kW</h4>";
|
||||
//content += "<h4>Max Stationary Heat Power: " + String(BMS_maxStationaryHeatPower) + " kWh</h4>"; // Not giving useable data
|
||||
//content += "<h4>HVAC Power Budget: " + String(BMS_hvacPowerBudget) + " kW</h4>"; // Not giving useable data
|
||||
//content += "<h4>Not Enough Power For Heat Pump: " + String(noYes[datalayer_extended.tesla.BMS_notEnoughPowerForHeatPump]) + "</h4>"; // Not giving useable data
|
||||
content +=
|
||||
"<h4>Power Limit State: " + String(BMS_powerLimitState[datalayer_extended.tesla.BMS_powerLimitState]) + "</h4>";
|
||||
//content += "<h4>Inverter TQF: " + String(datalayer_extended.tesla.BMS_inverterTQF) + "</h4>"; // Not giving useable data
|
||||
//0x212 530 BMS_status
|
||||
content += "<h4>Isolation Resistance: " + String(isolationResistance) + " kOhms</h4>";
|
||||
content +=
|
||||
"<h4>BMS Contactor State: " + String(BMS_contactorState[datalayer_extended.tesla.battery_BMS_contactorState]) +
|
||||
"</h4>";
|
||||
content += "<h4>BMS State: " + String(BMS_state[datalayer_extended.tesla.battery_BMS_state]) + "</h4>";
|
||||
content += "<h4>BMS HV State: " + String(BMS_hvState[datalayer_extended.tesla.battery_BMS_hvState]) + "</h4>";
|
||||
content += "<h4>BMS UI Charge Status: " + String(BMS_uiChargeStatus[datalayer_extended.tesla.battery_BMS_hvState]) +
|
||||
"</h4>";
|
||||
content +=
|
||||
"<h4>BMS PCS PWM Enabled: " + String(Fault[datalayer_extended.tesla.battery_BMS_pcsPwmEnabled]) + "</h4>";
|
||||
//0x312 786 BMS_thermalStatus
|
||||
content += "<h4>Power Dissipation: " + String(BMS_powerDissipation) + " kW</h4>";
|
||||
content += "<h4>Flow Request: " + String(BMS_flowRequest) + " LPM</h4>";
|
||||
|
@ -304,36 +329,34 @@ class TeslaHtmlRenderer : public BatteryHtmlRenderer {
|
|||
content += "<h4>BMS No Flow Request: " + String(Fault[datalayer_extended.tesla.BMS_noFlowRequest]) + "</h4>";
|
||||
//0x224 548 PCS_dcdcStatus
|
||||
content +=
|
||||
"<h4>Precharge Status: " + String(PCS_dcdcStatus[datalayer_extended.tesla.battery_PCS_dcdcPrechargeStatus]) +
|
||||
"</h4>";
|
||||
content +=
|
||||
"<h4>12V Support Status: " + String(PCS_dcdcStatus[datalayer_extended.tesla.battery_PCS_dcdc12VSupportStatus]) +
|
||||
"</h4>";
|
||||
"<h4>Precharge Status: " + String(PCS_dcdcStatus[datalayer_extended.tesla.PCS_dcdcPrechargeStatus]) + "</h4>";
|
||||
content += "<h4>12V Support Status: " + String(PCS_dcdcStatus[datalayer_extended.tesla.PCS_dcdc12VSupportStatus]) +
|
||||
"</h4>";
|
||||
content += "<h4>HV Bus Discharge Status: " +
|
||||
String(PCS_dcdcStatus[datalayer_extended.tesla.battery_PCS_dcdcHvBusDischargeStatus]) + "</h4>";
|
||||
content +=
|
||||
"<h4>Main State: " + String(PCS_dcdcMainState[datalayer_extended.tesla.battery_PCS_dcdcMainState]) + "</h4>";
|
||||
content +=
|
||||
"<h4>Sub State: " + String(PCS_dcdcSubState[datalayer_extended.tesla.battery_PCS_dcdcSubState]) + "</h4>";
|
||||
content += "<h4>PCS Faulted: " + String(Fault[datalayer_extended.tesla.battery_PCS_dcdcFaulted]) + "</h4>";
|
||||
content +=
|
||||
"<h4>Output Is Limited: " + String(Fault[datalayer_extended.tesla.battery_PCS_dcdcOutputIsLimited]) + "</h4>";
|
||||
String(PCS_dcdcStatus[datalayer_extended.tesla.PCS_dcdcHvBusDischargeStatus]) + "</h4>";
|
||||
content += "<h4>Main State: " + String(PCS_dcdcMainState[datalayer_extended.tesla.PCS_dcdcMainState]) + "</h4>";
|
||||
content += "<h4>Sub State: " + String(PCS_dcdcSubState[datalayer_extended.tesla.PCS_dcdcSubState]) + "</h4>";
|
||||
content += "<h4>PCS Faulted: " + String(Fault[datalayer_extended.tesla.PCS_dcdcFaulted]) + "</h4>";
|
||||
content += "<h4>Output Is Limited: " + String(Fault[datalayer_extended.tesla.PCS_dcdcOutputIsLimited]) + "</h4>";
|
||||
content += "<h4>Max Output Current Allowed: " + String(PCS_dcdcMaxOutputCurrentAllowed) + " A</h4>";
|
||||
content += "<h4>Precharge Rty Cnt: " + String(falseTrue[datalayer_extended.tesla.battery_PCS_dcdcPrechargeRtyCnt]) +
|
||||
"</h4>";
|
||||
content +=
|
||||
"<h4>12V Support Rty Cnt: " + String(falseTrue[datalayer_extended.tesla.battery_PCS_dcdc12VSupportRtyCnt]) +
|
||||
"<h4>Precharge Rty Cnt: " + String(falseTrue[datalayer_extended.tesla.PCS_dcdcPrechargeRtyCnt]) + "</h4>";
|
||||
content +=
|
||||
"<h4>12V Support Rty Cnt: " + String(falseTrue[datalayer_extended.tesla.PCS_dcdc12VSupportRtyCnt]) + "</h4>";
|
||||
content +=
|
||||
"<h4>Discharge Rty Cnt: " + String(falseTrue[datalayer_extended.tesla.PCS_dcdcDischargeRtyCnt]) + "</h4>";
|
||||
content += "<h4>PWM Enable Line: " + String(Fault[datalayer_extended.tesla.PCS_dcdcPwmEnableLine]) + "</h4>";
|
||||
content +=
|
||||
"<h4>Supporting Fixed LV Target: " + String(Fault[datalayer_extended.tesla.PCS_dcdcSupportingFixedLvTarget]) +
|
||||
"</h4>";
|
||||
content += "<h4>Discharge Rty Cnt: " + String(falseTrue[datalayer_extended.tesla.battery_PCS_dcdcDischargeRtyCnt]) +
|
||||
content += "<h4>Precharge Restart Cnt: " + String(falseTrue[datalayer_extended.tesla.PCS_dcdcPrechargeRestartCnt]) +
|
||||
"</h4>";
|
||||
content +=
|
||||
"<h4>PWM Enable Line: " + String(Fault[datalayer_extended.tesla.battery_PCS_dcdcPwmEnableLine]) + "</h4>";
|
||||
content += "<h4>Supporting Fixed LV Target: " +
|
||||
String(Fault[datalayer_extended.tesla.battery_PCS_dcdcSupportingFixedLvTarget]) + "</h4>";
|
||||
content += "<h4>Precharge Restart Cnt: " +
|
||||
String(falseTrue[datalayer_extended.tesla.battery_PCS_dcdcPrechargeRestartCnt]) + "</h4>";
|
||||
content += "<h4>Initial Precharge Substate: " +
|
||||
String(PCS_dcdcSubState[datalayer_extended.tesla.battery_PCS_dcdcInitialPrechargeSubState]) + "</h4>";
|
||||
String(PCS_dcdcSubState[datalayer_extended.tesla.PCS_dcdcInitialPrechargeSubState]) + "</h4>";
|
||||
//0x3C4 PCS_info
|
||||
content += "<h4>PCS_buildConfigId: " + String(datalayer_extended.tesla.PCS_info_buildConfigId) + "</h4>";
|
||||
content += "<h4>PCS_hardwareId: " + String(datalayer_extended.tesla.PCS_info_hardwareId) + "</h4>";
|
||||
content += "<h4>PCS_componentId: " + String(datalayer_extended.tesla.PCS_info_componentId) + "</h4>";
|
||||
//0x2C4 708 PCS_logging
|
||||
content += "<h4>PCS_dcdcMaxLvOutputCurrent: " + String(PCS_dcdcMaxLvOutputCurrent) + " A</h4>";
|
||||
content += "<h4>PCS_dcdcCurrentLimit: " + String(PCS_dcdcCurrentLimit) + " A</h4>";
|
||||
|
@ -355,6 +378,10 @@ class TeslaHtmlRenderer : public BatteryHtmlRenderer {
|
|||
content += "<h4>PCS_dcdcIntervalMinLvBusVolt: " + String(PCS_dcdcIntervalMinLvBusVolt) + " V</h4>";
|
||||
content += "<h4>PCS_dcdcIntervalMinLvOutputCurr: " + String(PCS_dcdcIntervalMinLvOutputCurr) + " A</h4>";
|
||||
content += "<h4>PCS_dcdc12vSupportLifetimekWh: " + String(PCS_dcdc12vSupportLifetimekWh) + " kWh</h4>";
|
||||
//0x310 HVP_info
|
||||
content += "<h4>HVP_buildConfigId: " + String(datalayer_extended.tesla.HVP_info_buildConfigId) + "</h4>";
|
||||
content += "<h4>HVP_hardwareId: " + String(datalayer_extended.tesla.HVP_info_hardwareId) + "</h4>";
|
||||
content += "<h4>HVP_componentId: " + String(datalayer_extended.tesla.HVP_info_componentId) + "</h4>";
|
||||
//0x7AA 1962 HVP_debugMessage
|
||||
content += "<h4>HVP_battery12V: " + String(HVP_battery12V) + " V</h4>";
|
||||
content += "<h4>HVP_dcLinkVoltage: " + String(HVP_dcLinkVoltage) + " V</h4>";
|
||||
|
|
|
@ -355,9 +355,9 @@ typedef struct {
|
|||
typedef struct {
|
||||
/** uint8_t */
|
||||
/** Contactor status */
|
||||
uint8_t status_contactor = 0;
|
||||
//uint8_t status_contactor = 0;
|
||||
/** uint8_t */
|
||||
/** Contactor status */
|
||||
/** HVIL status */
|
||||
uint8_t hvil_status = 0;
|
||||
/** uint8_t */
|
||||
/** Negative contactor state */
|
||||
|
@ -366,12 +366,12 @@ typedef struct {
|
|||
/** Positive contactor state */
|
||||
uint8_t packContPositiveState = 0;
|
||||
/** uint8_t */
|
||||
/** Set state of contactors */
|
||||
/** HVP set state of contactors */
|
||||
uint8_t packContactorSetState = 0;
|
||||
/** uint8_t */
|
||||
/** Battery pack allows closing of contacors */
|
||||
uint8_t packCtrsClosingAllowed = 0;
|
||||
/** uint8_t */
|
||||
/** bool */
|
||||
/** Battery pack allows closing of contactors */
|
||||
bool packCtrsClosingBlocked = false;
|
||||
/** bool */
|
||||
/** Pyro test in progress */
|
||||
bool pyroTestInProgress = false;
|
||||
bool battery_packCtrsOpenNowRequested = false;
|
||||
|
@ -379,7 +379,22 @@ typedef struct {
|
|||
uint8_t battery_packCtrsRequestStatus = 0;
|
||||
bool battery_packCtrsResetRequestRequired = false;
|
||||
bool battery_dcLinkAllowedToEnergize = false;
|
||||
uint8_t BMS_SerialNumber[15] = {0}; //stores raw HEX values for ASCII chars
|
||||
uint8_t BMS_partNumber[12] = {0}; //stores raw HEX values for ASCII chars
|
||||
uint16_t BMS_info_buildConfigId = 0;
|
||||
uint16_t BMS_info_hardwareId = 0;
|
||||
uint16_t BMS_info_componentId = 0;
|
||||
uint8_t BMS_info_pcbaId = 0;
|
||||
uint8_t BMS_info_assemblyId = 0;
|
||||
uint16_t BMS_info_usageId = 0;
|
||||
uint16_t BMS_info_subUsageId = 0;
|
||||
uint8_t BMS_info_platformType = 0;
|
||||
uint32_t BMS_info_appCrc = 0;
|
||||
uint64_t BMS_info_bootGitHash = 0;
|
||||
uint8_t BMS_info_bootUdsProtoVersion = 0;
|
||||
uint32_t BMS_info_bootCrc = 0;
|
||||
uint8_t battery_serialNumber[15] = {0}; //stores raw HEX values for ASCII chars
|
||||
uint8_t battery_partNumber[12] = {0}; //stores raw HEX values for ASCII chars
|
||||
char* battery_manufactureDate;
|
||||
uint8_t battery_beginning_of_life = 0;
|
||||
uint8_t battery_battTempPct = 0;
|
||||
uint16_t battery_dcdcLvBusVolt = 0;
|
||||
|
@ -413,37 +428,23 @@ typedef struct {
|
|||
uint16_t battery_reservedConfig = 0;
|
||||
uint32_t battery_packMass = 0;
|
||||
uint32_t battery_platformMaxBusVoltage = 0;
|
||||
uint32_t battery_bms_min_voltage = 0;
|
||||
uint32_t battery_bms_max_voltage = 0;
|
||||
uint32_t BMS_min_voltage = 0;
|
||||
uint32_t BMS_max_voltage = 0;
|
||||
uint32_t battery_max_charge_current = 0;
|
||||
uint32_t battery_max_discharge_current = 0;
|
||||
uint32_t battery_soc_min = 0;
|
||||
uint32_t battery_soc_max = 0;
|
||||
uint32_t battery_soc_ave = 0;
|
||||
uint32_t battery_soc_ui = 0;
|
||||
uint8_t battery_BMS_contactorState = 0;
|
||||
uint8_t battery_BMS_state = 0;
|
||||
uint8_t battery_BMS_hvState = 0;
|
||||
uint16_t battery_BMS_isolationResistance = 0;
|
||||
uint8_t battery_BMS_uiChargeStatus = 0;
|
||||
bool battery_BMS_diLimpRequest = false;
|
||||
uint16_t battery_BMS_chgPowerAvailable = 0;
|
||||
bool battery_BMS_pcsPwmEnabled = false;
|
||||
uint8_t battery_PCS_dcdcPrechargeStatus = 0;
|
||||
uint8_t battery_PCS_dcdc12VSupportStatus = 0;
|
||||
uint8_t battery_PCS_dcdcHvBusDischargeStatus = 0;
|
||||
uint8_t battery_PCS_dcdcMainState = 0;
|
||||
uint8_t battery_PCS_dcdcSubState = 0;
|
||||
bool battery_PCS_dcdcFaulted = false;
|
||||
bool battery_PCS_dcdcOutputIsLimited = false;
|
||||
uint16_t battery_PCS_dcdcMaxOutputCurrentAllowed = 0;
|
||||
uint8_t battery_PCS_dcdcPrechargeRtyCnt = 0;
|
||||
uint8_t battery_PCS_dcdc12VSupportRtyCnt = 0;
|
||||
uint8_t battery_PCS_dcdcDischargeRtyCnt = 0;
|
||||
uint8_t battery_PCS_dcdcPwmEnableLine = 0;
|
||||
uint8_t battery_PCS_dcdcSupportingFixedLvTarget = 0;
|
||||
uint8_t battery_PCS_dcdcPrechargeRestartCnt = 0;
|
||||
uint8_t battery_PCS_dcdcInitialPrechargeSubState = 0;
|
||||
bool BMS_hvilFault = false;
|
||||
uint8_t BMS_contactorState = 0;
|
||||
uint8_t BMS_state = 0;
|
||||
uint8_t BMS_hvState = 0;
|
||||
uint16_t BMS_isolationResistance = 0;
|
||||
uint8_t BMS_uiChargeStatus = 0;
|
||||
bool BMS_diLimpRequest = false;
|
||||
uint16_t BMS_chgPowerAvailable = 0;
|
||||
bool BMS_pcsPwmEnabled = false;
|
||||
uint16_t BMS_maxRegenPower = 0;
|
||||
uint16_t BMS_maxDischargePower = 0;
|
||||
uint16_t BMS_maxStationaryHeatPower = 0;
|
||||
|
@ -460,6 +461,35 @@ typedef struct {
|
|||
uint16_t BMS_packTMax = 0;
|
||||
bool BMS_pcsNoFlowRequest = false;
|
||||
bool BMS_noFlowRequest = false;
|
||||
uint8_t PCS_dcdcPrechargeStatus = 0;
|
||||
uint8_t PCS_dcdc12VSupportStatus = 0;
|
||||
uint8_t PCS_dcdcHvBusDischargeStatus = 0;
|
||||
uint8_t PCS_dcdcMainState = 0;
|
||||
uint8_t PCS_dcdcSubState = 0;
|
||||
bool PCS_dcdcFaulted = false;
|
||||
bool PCS_dcdcOutputIsLimited = false;
|
||||
uint16_t PCS_dcdcMaxOutputCurrentAllowed = 0;
|
||||
uint8_t PCS_dcdcPrechargeRtyCnt = 0;
|
||||
uint8_t PCS_dcdc12VSupportRtyCnt = 0;
|
||||
uint8_t PCS_dcdcDischargeRtyCnt = 0;
|
||||
uint8_t PCS_dcdcPwmEnableLine = 0;
|
||||
uint8_t PCS_dcdcSupportingFixedLvTarget = 0;
|
||||
uint8_t PCS_dcdcPrechargeRestartCnt = 0;
|
||||
uint8_t PCS_dcdcInitialPrechargeSubState = 0;
|
||||
uint8_t PCS_partNumber[13] = {0}; //stores raw HEX values for ASCII chars
|
||||
uint16_t PCS_info_buildConfigId = 0;
|
||||
uint16_t PCS_info_hardwareId = 0;
|
||||
uint16_t PCS_info_componentId = 0;
|
||||
uint8_t PCS_info_pcbaId = 0;
|
||||
uint8_t PCS_info_assemblyId = 0;
|
||||
uint16_t PCS_info_usageId = 0;
|
||||
uint16_t PCS_info_subUsageId = 0;
|
||||
uint8_t PCS_info_platformType = 0;
|
||||
uint32_t PCS_info_appCrc = 0;
|
||||
uint32_t PCS_info_cpu2AppCrc = 0;
|
||||
uint64_t PCS_info_bootGitHash = 0;
|
||||
uint8_t PCS_info_bootUdsProtoVersion = 0;
|
||||
uint32_t PCS_info_bootCrc = 0;
|
||||
uint16_t PCS_dcdcTemp = 0;
|
||||
uint16_t PCS_ambientTemp = 0;
|
||||
uint16_t PCS_chgPhATemp = 0;
|
||||
|
@ -516,6 +546,19 @@ typedef struct {
|
|||
bool HVP_currentSenseMia = false;
|
||||
bool HVP_shuntRefVoltageMismatch = false;
|
||||
bool HVP_shuntThermistorMia = false;
|
||||
uint8_t HVP_partNumber[13] = {0}; //stores raw HEX values for ASCII chars
|
||||
uint16_t HVP_info_buildConfigId = 0;
|
||||
uint16_t HVP_info_hardwareId = 0;
|
||||
uint16_t HVP_info_componentId = 0;
|
||||
uint8_t HVP_info_pcbaId = 0;
|
||||
uint8_t HVP_info_assemblyId = 0;
|
||||
uint16_t HVP_info_usageId = 0;
|
||||
uint16_t HVP_info_subUsageId = 0;
|
||||
uint8_t HVP_info_platformType = 0;
|
||||
uint32_t HVP_info_appCrc = 0;
|
||||
uint64_t HVP_info_bootGitHash = 0;
|
||||
uint8_t HVP_info_bootUdsProtoVersion = 0;
|
||||
uint32_t HVP_info_bootCrc = 0;
|
||||
uint8_t HVP_shuntHwMia = 0;
|
||||
uint16_t HVP_dcLinkVoltage = 0;
|
||||
uint16_t HVP_packVoltage = 0;
|
||||
|
@ -541,27 +584,6 @@ typedef struct {
|
|||
uint8_t HVP_shuntAuxCurrentStatus = 0;
|
||||
uint8_t HVP_shuntBarTempStatus = 0;
|
||||
uint8_t HVP_shuntAsicTempStatus = 0;
|
||||
uint16_t BMS_info_buildConfigId = 0;
|
||||
uint16_t BMS_info_hardwareId = 0;
|
||||
uint16_t BMS_info_componentId = 0;
|
||||
uint8_t BMS_info_pcbaId = 0;
|
||||
uint8_t BMS_info_assemblyId = 0;
|
||||
uint16_t BMS_info_usageId = 0;
|
||||
uint16_t BMS_info_subUsageId = 0;
|
||||
uint8_t BMS_info_platformType = 0;
|
||||
uint32_t BMS_info_appCrc = 0;
|
||||
uint64_t BMS_info_bootGitHash = 0;
|
||||
uint8_t BMS_info_bootUdsProtoVersion = 0;
|
||||
uint32_t BMS_info_bootCrc = 0;
|
||||
uint16_t HVP_info_buildConfigId = 0;
|
||||
uint16_t HVP_info_hardwareId = 0;
|
||||
uint16_t HVP_info_componentId = 0;
|
||||
uint8_t battery_serialNumber[14] = {0}; // Stores raw HEX values for ASCII chars
|
||||
uint8_t battery_partNumber[12] = {0};
|
||||
uint8_t PCS_partNumber[12] = {0}; //stores raw HEX values for ASCII chars
|
||||
uint16_t PCS_info_buildConfigId = 0;
|
||||
uint16_t PCS_info_hardwareId = 0;
|
||||
uint16_t PCS_info_componentId = 0;
|
||||
} DATALAYER_INFO_TESLA;
|
||||
|
||||
typedef struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue