MPPT algorithm improvements and CAN data logging added

This commit is contained in:
Martin Jäger
2018-03-02 23:59:52 +01:00
parent ba9a600f93
commit e10b5165a2
14 changed files with 932 additions and 384 deletions
@@ -21,6 +21,7 @@ ChargeController::ChargeController(ChargingProfile& profile) :
_profile(profile)
{
_charging_enabled = false;
_time_state_changed = -profile.time_limit_recharge; // start immediately
}
/*****************************************************************************
@@ -56,6 +57,8 @@ ChargeController::ChargeController(ChargingProfile& profile) :
void ChargeController::update(float battery_voltage, float battery_current) {
//printf("_time_state_change = %d, time = %d, v_bat = %f, i_bat = %f\n", _time_state_changed, time(NULL), battery_voltage, battery_current);
// Load management
if (battery_voltage < _profile.cell_voltage_load_disconnect * _profile.num_cells) {
_discharging_enabled = false;