Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-ev-fuse-recovery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ftw": patch
---

Let home battery charging yield to the car and resume EV charging once measured fuse headroom is stable, without a fixed five-minute pause. Avoid repeated cuts from the same phase reading and reserve room for commands that have not yet appeared in meter data.
5 changes: 5 additions & 0 deletions go/cmd/ftw/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3027,6 +3027,10 @@ func main() {
// resume charging.
evCurtailHeadroomW := loadpoint.SurplusPotentialW(lpStatesSnapshot)
boostEVW, boostReserveSoC := activeBatteryBoostTotals(lpController, lpStatesSnapshot, tickNow)
var evFuseDemands []loadpoint.FuseDemand
if lpController != nil {
evFuseDemands = lpController.FuseDemands()
}

ctrlMu.Lock()
ctrl.EVSurplusOnlyReserveW = evReserveW
Expand All @@ -3035,6 +3039,7 @@ func main() {
ctrl.BatteryBoostEVChargingW = boostEVW
ctrl.BatteryBoostReserveSoC = boostReserveSoC
ctrl.EVCommandedW = loadpoint.CommandedEVPowerW(lpStatesSnapshot)
ctrl.SetEVFuseDemands(evFuseDemands)
fuseMaxW := ctrl.SiteFuseAmps * ctrl.SiteFuseVoltage * float64(ctrl.SiteFusePhases)
targets := control.ComputeDispatch(tel, ctrl, capsSnap, fuseMaxW)
planMissingNow := ctrl.Mode.IsPlannerMode() && ctrl.PlanStale
Expand Down
5 changes: 5 additions & 0 deletions go/internal/control/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ type State struct {
// It reserves site capacity before optional battery charging, even before
// an EV ramps up and in modes without an accepted optimizer plan.
EVCommandedW float64
// evFuseDemands keeps this tick's intent before the fuse clamp so optional
// battery charging yields even when the EV cannot start yet.
evFuseDemands []evFuseDemand
evFuseDemandsSet bool

// PI controller (outer, site-level)
PI *PIController
Expand Down Expand Up @@ -2354,6 +2358,7 @@ func applyDispatchSafetyPipeline(
}
targets = floorMissingSoCDischarge(targets, store)
targets = state.floorFullBatteryCharge(targets)
targets = clampEVBatteryHeadroom(targets, store, state, fuseMaxW)
republishFuseEVCapAfterFuseDischarge(targets, store, state, fuseMaxW)
recordDispatchTargets(targets, state, opts.updatePrevTargets, opts.recordDispatch)
return targets
Expand Down
Loading
Loading