Fix for #44 (Wrong DCDC power calculation) (#45)

The dcdc power has to use the dcdc current and voltage instead of the
output voltage (which can be low side - buck or high side - boost) and
the dcdc current instead of the out current. See #44 for the discussion
on this issue.
This commit is contained in:
hogthrob
2019-08-26 07:36:13 +02:00
committed by Martin Jäger
parent 3f4f52ea18
commit 01edcbcf07
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -104,6 +104,7 @@ void update_measurements(Dcdc *dcdc, Charger *charger, DcBus *hs, DcBus *ls, DcB
ADC_GAIN_V_BAT / 1000.0;
load_bus->voltage = ls->voltage;
dcdc->ls_voltage = ls->voltage;
hs->voltage =
(float)(((adc_filtered[ADC_POS_V_SOLAR] >> (4 + ADC_FILTER_CONST)) * vcc) / 4096) *