Skip to content

Commit

Permalink
Merge pull request #513 from dalathegreat/bugfix/solax-user-limits
Browse files Browse the repository at this point in the history
Bugfix: Solax respect user set limits
  • Loading branch information
dalathegreat authored Oct 4, 2024
2 parents f7ae4a6 + ffd2a7c commit f243bd8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Software/src/inverter/SOLAX-CAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ void update_values_can_inverter() { //This function maps all the values fetched
}
}

//Cap the value according to user settings. Some inverters cannot handle large values.
if ((max_charge_rate_amp * 10) > datalayer.battery.info.max_charge_amp_dA) {
max_charge_rate_amp = (datalayer.battery.info.max_charge_amp_dA / 10);
}
if ((max_discharge_rate_amp * 10) > datalayer.battery.info.max_discharge_amp_dA) {
max_discharge_rate_amp = (datalayer.battery.info.max_discharge_amp_dA / 10);
}

// Batteries might be larger than uint16_t value can take
if (datalayer.battery.info.total_capacity_Wh > 65000) {
capped_capacity_Wh = 65000;
Expand Down

0 comments on commit f243bd8

Please sign in to comment.