LibreSolar / charge-controller-firmware

Firmware for Libre Solar MPPT/PWM charge controllers
https://libre.solar/charge-controller-firmware/
Apache License 2.0
144 stars 71 forks source link

Not charging with 24V system #95

Closed DeeFuse closed 4 years ago

DeeFuse commented 4 years ago

I've updated my MPPT-2420-lc to the latest firmware and noticed it not starting to charge the battery. I narrowed it down to the variable lvs->bus->sink_voltage_bound sitting at 14.4V even though it detected it as 24V system correctyl.

Due to that circumstance, the function int Dcdc::check_start_conditions() in dcdc.cpp:L131 always returns "0". It should return 1 to start buck mode but the statement in dcdc.cpp:L144 is always false lvs->bus->voltage [24.48] < lvs->bus->sink_voltage_bound [14.4]

I think it should take port->bus->series_multiplier = 2 from bat_charger.cpp:L255 into account.

I fixed it by changing the expression in the if statement in dcdc.cpp:L144 to: lvs->bus->voltage < lvs->bus->sink_voltage_bound * lvs->bus->series_multiplier && But I don't know it there are other places that need adjustments to work properly.

martinjaeger commented 4 years ago

Thanks a lot for providing that bug report. I fixed it in above mentioned commit and also added a unit-test to check the dual battery configuration.