MCPcopy Create free account
hub / github.com/evcc-io/evcc / boostPower

Method boostPower

core/loadpoint.go:1492–1528  ·  view source on GitHub ↗

boostPower returns the additional power that the loadpoint should draw from the battery

(batteryBoostPower float64)

Source from the content-addressed store, hash-verified

1490
1491// boostPower returns the additional power that the loadpoint should draw from the battery
1492func (lp *Loadpoint) boostPower(batteryBoostPower float64) float64 {
1493 boost := lp.GetBatteryBoost()
1494 if boost == boostDisabled {
1495 return 0
1496 }
1497
1498 // push demand to drain battery (at least 100W)
1499 delta := math.Max(100, math.Abs(lp.site.GetResidualPower()))
1500
1501 if lp.coarseCurrent() {
1502 // add effective step power to delta to make sure to step up to the next full amp
1503 // just using lp.EffectiveStepPower() as delta is not enough because this will result
1504 // in a too low current when there is a bit remaining grid consumption due to the accuracy
1505 // of the battery controller
1506 delta += lp.EffectiveStepPower()
1507 }
1508
1509 // start boosting by setting maximum power
1510 if boost == boostStart {
1511 delta = lp.EffectiveMaxPower()
1512
1513 // expire timers
1514 if lp.hasPhaseSwitching() {
1515 lp.phaseTimer = elapsed
1516 }
1517 lp.pvTimer = elapsed
1518
1519 if lp.charging() {
1520 lp.setBatteryBoost(boostContinue)
1521 }
1522 }
1523
1524 res := batteryBoostPower + delta + lp.site.GetResidualPower()
1525 lp.log.DEBUG.Printf("pv charge battery boost: %.0fW = -%.0fW battery - %.0fW boost", -res, batteryBoostPower, delta)
1526
1527 return res
1528}
1529
1530// pvMaxCurrent calculates the maximum target current for PV mode
1531func (lp *Loadpoint) pvMaxCurrent(mode api.ChargeMode, sitePower, batteryBoostPower float64, batteryBuffered, batteryStart bool) float64 {

Callers 1

pvMaxCurrentMethod · 0.95

Calls 9

GetBatteryBoostMethod · 0.95
coarseCurrentMethod · 0.95
EffectiveStepPowerMethod · 0.95
EffectiveMaxPowerMethod · 0.95
hasPhaseSwitchingMethod · 0.95
chargingMethod · 0.95
setBatteryBoostMethod · 0.95
PrintfMethod · 0.80
GetResidualPowerMethod · 0.65

Tested by

no test coverage detected