Update of DC/DC lv side targets based on bat + load
This commit is contained in:
@@ -441,3 +441,14 @@ void battery_init_dc_bus(DcBus *bus, BatConf *bat, unsigned int num_batteries)
|
||||
// negative sign for compensation of actual resistance
|
||||
bus->chg_droop_res = -bat->wire_resistance * n;
|
||||
}
|
||||
|
||||
void charger_update_junction_bus(DcBus *junction, DcBus *bat, DcBus *load)
|
||||
{
|
||||
// relevant for DC/DC
|
||||
junction->chg_current_max = bat->chg_current_max - bat->current + load->current;
|
||||
junction->chg_voltage_target = bat->chg_voltage_target;
|
||||
|
||||
// relevant for load output
|
||||
junction->dis_voltage_start = bat->dis_voltage_start;
|
||||
junction->dis_voltage_stop = bat->dis_voltage_stop;
|
||||
}
|
||||
|
||||
@@ -347,4 +347,8 @@ void charger_detect_num_batteries(Charger *charger, BatConf *bat, DcBus *bus);
|
||||
*/
|
||||
void charger_state_machine(DcBus *port, BatConf *bat_conf, Charger *charger);
|
||||
|
||||
/** Calculates targets for junction of load and battery bus at the DC/DC output
|
||||
*/
|
||||
void charger_update_junction_bus(DcBus *junction, DcBus *bat, DcBus *load);
|
||||
|
||||
#endif /* BAT_CHARGER_H */
|
||||
|
||||
@@ -191,6 +191,8 @@ int main()
|
||||
|
||||
charger_state_machine(bat_terminal, &bat_conf, &charger);
|
||||
|
||||
charger_update_junction_bus(&lv_bus_int, bat_terminal, &load_terminal);
|
||||
|
||||
load_state_machine(&load, lv_terminal.dis_allowed);
|
||||
|
||||
eeprom_update();
|
||||
|
||||
Reference in New Issue
Block a user