Battery discharging control restructured

- Discharging control separated from charger state machine
- Unit-tests for discharging control added
- DC bus chg/dis_enabled flags removed, control now only based on chge/dis_current_limit values
- _current_max values renamed to _limit to make more clear that values for discharging direction must be negative
- Load output struct now stores pointer to internal and external DC bus objects
This commit is contained in:
Martin Jaeger
2019-10-16 16:04:21 +02:00
parent cce6e2a9b3
commit f33146e9de
17 changed files with 217 additions and 102 deletions
+1 -1
View File
@@ -122,7 +122,7 @@ void uext_process_1s()
oled.setTextCursor(90, 18);
oled.printf("%5.1fW", (abs(load_terminal.power) < 0.1) ? 0 : load_terminal.power); // remove negative zeros
oled.setTextCursor(90, 26);
oled.printf("%5.1fA\n", (abs(load.bus->current) < 0.1) ? 0 : load.bus->current);
oled.printf("%5.1fA\n", (abs(load_terminal.current) < 0.1) ? 0 : load_terminal.current);
oled.setTextCursor(0, 36);
oled.printf("Day +%5.0fWh -%5.0fWh", solar_terminal->dis_energy_Wh, fabs(load_terminal.chg_energy_Wh));