Lemonergy · Studio block

Charging schedule and target policy

Sampled permission, current and power requests for an explicit charging target.

Implementation ID
charging-policy
Reviewed
2026-10-27

Behavior

The immediate, scheduled, opportunity and maintenance strategies use connection, availability, BMS permission and temperature signals. Outputs request charging; the separate regulated charger solves delivered terminal power. Departure shortfall reports unmet demand rather than manufacturing energy.

Interface

Charging schedule and target policy interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Charging schedule and target policyStudio blocksocconnectedavailablebmsPermittemperaturesitePowerchargerDonepermitrequestPowercurrentCappricestatereasonshortfallJdepartureShortfallJtargetSoc
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
socinputfractionTyped signal input; its quantity must match the connected output.
connectedinputdimensionlessTyped signal input; its quantity must match the connected output.
availableinputdimensionlessTyped signal input; its quantity must match the connected output.
bmsPermitinputdimensionlessTyped signal input; its quantity must match the connected output.
temperatureinputKTyped signal input; its quantity must match the connected output.
sitePowerinputWTyped signal input; its quantity must match the connected output.
chargerDoneinputdimensionlessTyped signal input; its quantity must match the connected output.
permitoutput0 or 1Observed result from the solved component or sampled controller.
requestPoweroutputWObserved result from the solved component or sampled controller.
currentCapoutputAObserved result from the solved component or sampled controller.
priceoutputcurrency/kWhObserved result from the solved component or sampled controller.
stateoutputcodeObserved result from the solved component or sampled controller.
reasonoutputcodeObserved result from the solved component or sampled controller.
shortfallJoutputJObserved result from the solved component or sampled controller.
departureShortfallJoutputJObserved result from the solved component or sampled controller.
targetSocoutputfractionObserved result from the solved component or sampled controller.

Parameters

Defaults are initial model values. Select values for your own model and operating conditions.

Configuration fields
ParameterUnitDefaultMeaning and limits
Sample Time S
sampleTimeS
s1Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0.001; Maximum 3600
Strategy
strategy
0 immediate, 1 scheduled, 2 opportunity, 3 maintenance1Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 3
Chemistry
chemistry
0 Li-ion, 1 lead-acid0Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1
Target Soc
targetSoc
fraction0.8Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1
Restart Soc
restartSoc
fraction0.7Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1
Departure S
departureS
s (0 disables departure)86400Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000
Max Power W
maxPowerW
W grid-side7000Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000
Max Current A
maxCurrentA
A32Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000
Capacity Ah
capacityAh
Ah100Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 1e-06; Maximum 1000000000
Nominal Voltage V
nominalVoltageV
V350Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0.01; Maximum 1000000
Min Temperature K
minTemperatureK
K273.15Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 1; Maximum 1000
Max Temperature K
maxTemperatureK
K318.15Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 1; Maximum 1000
Price Per KWh
pricePerKWh
currency/kWh0.2Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000
Start S
startS
s0Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000
End S
endS
s86400Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000
Repeat Period S
repeatPeriodS
s (0 absolute)0Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000

Equations and rules

This step is defined by its sequence and stopping conditions, described above.

Worked example

Build CC–CV charging

An illustrative 100 Ah battery with a 420 V ceiling can use a 32 A cap. At the ceiling, current falls as OCV rises.

Open the Studio example →

Use in a workflow

Build CC–CV charging

Native current and voltage regulation act against an explicit battery.

  1. Charging schedule and target policy: Permits charging
    • strategy
    • targetSoc
    • departureS
    • soc, available, chargerDone → permit
Open the Studio example

Share a site supply

Multiple branches share one power cap.

  1. Charging schedule and target policy: Permits charging
    • strategy
    • targetSoc
    • departureS
    • soc, available, chargerDone → permit
Open the Studio example

Compare charging policies

Compare authored schedules on the same hardware.

  1. Charging schedule and target policy: Permits charging
    • strategy
    • targetSoc
    • departureS
    • soc, available, chargerDone → permit
Open the Studio example

Separate low current from float

Bounded lithium charging and lead-acid maintenance are distinct.

  1. Charging schedule and target policy: Permits charging
    • strategy
    • targetSoc
    • departureS
    • soc, available, chargerDone → permit
Open the Studio example

Charge during available stops

Availability is an independent signal.

  1. Charging schedule and target policy: Permits charging
    • strategy
    • targetSoc
    • departureS
    • soc, available, chargerDone → permit
Open the Studio example

Connected concepts

Limits and interpretation

  • The battery uses linear OCV and fixed resistance. It does not automatically add aging, thermal dynamics or balancing.
  • This is deterministic policy comparison, not a forecast or economic optimum.
  • Downstream unused capacity is not silently redistributed.
  • All battery and converter limits still apply. A schedule is not an electrochemical law.
  • These effective parameters are not a recipe. Lithium-ion does not use indefinite trickle or lead-acid float.

Implementation sources

This reference follows Lemonergy implementation sources. Scientific articles support the linked concepts separately.

Repository: battery-design · Revision: ef9802329b75bc15bb96885f8ed5d49425106696

  • js/charging-control.js
  • js/charging-scenarios.js
  • docs/CHARGING_BLOCKS_SPEC.md
  • js/physical-network.js
  • rust-core/src/charging_control.rs

This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)