Skip to content

Commit

Permalink
Merge pull request #875 from dalathegreat/bugfix/BYD-CAN-SOC-stop
Browse files Browse the repository at this point in the history
BYD CAN: Safety, add overriding SOC incase of 0W allowed
  • Loading branch information
dalathegreat authored Feb 12, 2025
2 parents f5927db + 7cedfb2 commit 8abdda5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Software/src/inverter/BYD-CAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ void update_values_can_inverter() { //This function maps all the values fetched
//SOC (100.00%)
BYD_150.data.u8[0] = (datalayer.battery.status.reported_soc >> 8);
BYD_150.data.u8[1] = (datalayer.battery.status.reported_soc & 0x00FF);
if (datalayer.battery.status.max_charge_current_dA == 0) {
//Force to 100.00% incase battery no longer wants to charge
BYD_150.data.u8[0] = (10000 >> 8);
BYD_150.data.u8[1] = (10000 & 0x00FF);
}
if (datalayer.battery.status.max_discharge_current_dA == 0) {
//Force to 0% incase battery no longer wants to discharge
BYD_150.data.u8[0] = 0;
BYD_150.data.u8[1] = 0;
}
//StateOfHealth (100.00%)
BYD_150.data.u8[2] = (datalayer.battery.status.soh_pptt >> 8);
BYD_150.data.u8[3] = (datalayer.battery.status.soh_pptt & 0x00FF);
Expand Down

0 comments on commit 8abdda5

Please sign in to comment.