Skip to content

Charge Strategy

The Charge strategy charges the battery at maximum power until MaxStateOfCharge is reached, then holds it at Idle until the strategy changes.

How It Works

For common behaviour shared by all strategies (mode gate, SoC guard, base class helpers), see the Strategies overview.

Each time the strategy fires it runs through this pipeline:

The strategy is intentionally minimal. It reads the current battery status, checks a single condition, and dispatches one of two setpoints:

  • SoC below MaxStateOfCharge - charges at MaxChargePower. The battery draws as much power as it can accept up to the configured limit.
  • SoC at or above MaxStateOfCharge - sends an Idle setpoint (0 W). This keeps the battery from overcharging rather than simply doing nothing, ensuring the device actively transitions out of any previous charge state.

There is no ramping, rate limiting, or feedback loop. The strategy runs the battery at full charge rate until the ceiling is hit.

Configuration

The Charge strategy reads two values from BatteryConfiguration. Both are set per battery asset in the platform database and loaded on every control cycle via GetBatteryConfiguration.

ParameterDescription
MaxStateOfChargeUpper SoC limit (%). Charging stops and Idle is commanded once this is reached.
MaxChargePowerMaximum charge rate (W) sent as the setpoint while charging.

There are no strategy-specific tuning parameters - the Charge strategy has no deadband, rate limit, or quantization step of its own.

Behaviour Tests

Gateway mode gating is covered by GatewayModeBehaviorTests - see Strategies overview.

No dedicated tests

ChargeStrategy does not yet have dedicated unit or integration tests. The SoC guard and setpoint dispatch logic are straightforward enough to be covered by integration tests against a simulated battery; the mode-gate behaviour is already covered by GatewayModeBehaviorTests.