Skip to content

feat: SoC dependent power limits#34

Merged
bvweerd merged 2 commits intodevfrom
feature/soc-dependent-power-limits
Mar 25, 2026
Merged

feat: SoC dependent power limits#34
bvweerd merged 2 commits intodevfrom
feature/soc-dependent-power-limits

Conversation

@bvweerd
Copy link
Copy Markdown
Owner

@bvweerd bvweerd commented Mar 25, 2026

Description

Adds SoC dependent power limits (e.g. lower max power above 95% SoC)

Type of change

  • fix: Bug fix (patch version bump)
  • feat: New feature (minor version bump)
  • feat!: / BREAKING CHANGE: Breaking change (major version bump)
  • chore: / docs: / ci: Maintenance or documentation (no version bump)

Checklist

  • Commit title follows Conventional Commits (feat:, fix:, chore:, etc.)
  • Tests added or updated where applicable
  • Documentation updated if needed
  • CI is green
  • PR targets the dev branch (not main, unless this is a hotfix)

Screenshots / Logs (optional)

bvweerd and others added 2 commits March 24, 2026 19:22
Some batteries (e.g. Marstek Venus A) reduce charge/discharge power near
SoC extremes. Adds four optional config fields per battery subentry:
- high_soc_charge_threshold_pct / high_soc_max_charge_kw
- low_soc_discharge_threshold_pct / low_soc_max_discharge_kw

The DP precomputes per-state power limits and skips actions that exceed
them, so backward induction naturally front-loads discharge before the
battery enters the derated zone. The zero-grid controller applies the
same limits in real time. Defaults disable derating for existing configs.

Synced to analyzer.js and simulate_diagnostics.py per CLAUDE.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- test_battery_model: max_charge_at_soc / max_discharge_at_soc boundary
  tests, from_subentry round-trip, and aggregate_battery_configs suite
- test_optimizer: new TestSocDependentDerating class — verifies derated
  power is not exceeded near extremes and full power is available at
  mid-SoC; regression test that unrelated configs are unaffected
- ALGORITHM.md: Section 2 battery config table, Section 3.2 action grid
  note, Section 6 backward pass pseudocode and derating explanation,
  Section 11 numerical considerations row

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvement or addition to documentation enhancement New feature or improvement labels Mar 25, 2026
@bvweerd bvweerd merged commit e8ad786 into dev Mar 25, 2026
11 checks passed
@bvweerd bvweerd deleted the feature/soc-dependent-power-limits branch April 7, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvement or addition to documentation enhancement New feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant