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
| Name | Direction | Unit | Meaning |
|---|---|---|---|
soc | input | fraction | Typed signal input; its quantity must match the connected output. |
connected | input | dimensionless | Typed signal input; its quantity must match the connected output. |
available | input | dimensionless | Typed signal input; its quantity must match the connected output. |
bmsPermit | input | dimensionless | Typed signal input; its quantity must match the connected output. |
temperature | input | K | Typed signal input; its quantity must match the connected output. |
sitePower | input | W | Typed signal input; its quantity must match the connected output. |
chargerDone | input | dimensionless | Typed signal input; its quantity must match the connected output. |
permit | output | 0 or 1 | Observed result from the solved component or sampled controller. |
requestPower | output | W | Observed result from the solved component or sampled controller. |
currentCap | output | A | Observed result from the solved component or sampled controller. |
price | output | currency/kWh | Observed result from the solved component or sampled controller. |
state | output | code | Observed result from the solved component or sampled controller. |
reason | output | code | Observed result from the solved component or sampled controller. |
shortfallJ | output | J | Observed result from the solved component or sampled controller. |
departureShortfallJ | output | J | Observed result from the solved component or sampled controller. |
targetSoc | output | fraction | Observed result from the solved component or sampled controller. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Sample Time SsampleTimeS | s | 1 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0.001; Maximum 3600 |
Strategystrategy | 0 immediate, 1 scheduled, 2 opportunity, 3 maintenance | 1 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 3 |
Chemistrychemistry | 0 Li-ion, 1 lead-acid | 0 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1 |
Target SoctargetSoc | fraction | 0.8 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1 |
Restart SocrestartSoc | fraction | 0.7 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1 |
Departure SdepartureS | s (0 disables departure) | 86400 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000000 |
Max Power WmaxPowerW | W grid-side | 7000 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000000 |
Max Current AmaxCurrentA | A | 32 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000 |
Capacity AhcapacityAh | Ah | 100 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 1e-06; Maximum 1000000000 |
Nominal Voltage VnominalVoltageV | V | 350 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0.01; Maximum 1000000 |
Min Temperature KminTemperatureK | K | 273.15 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 1; Maximum 1000 |
Max Temperature KmaxTemperatureK | K | 318.15 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 1; Maximum 1000 |
Price Per KWhpricePerKWh | currency/kWh | 0.2 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000 |
Start SstartS | s | 0 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000000 |
End SendS | s | 86400 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000000 |
Repeat Period SrepeatPeriodS | s (0 absolute) | 0 | Configured 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.
- Charging schedule and target policy: Permits charging
- strategy
- targetSoc
- departureS
- soc, available, chargerDone → permit
Share a site supply
Multiple branches share one power cap.
- Charging schedule and target policy: Permits charging
- strategy
- targetSoc
- departureS
- soc, available, chargerDone → permit
Compare charging policies
Compare authored schedules on the same hardware.
- Charging schedule and target policy: Permits charging
- strategy
- targetSoc
- departureS
- soc, available, chargerDone → permit
Separate low current from float
Bounded lithium charging and lead-acid maintenance are distinct.
- Charging schedule and target policy: Permits charging
- strategy
- targetSoc
- departureS
- soc, available, chargerDone → permit
Charge during available stops
Availability is an independent signal.
- Charging schedule and target policy: Permits charging
- strategy
- targetSoc
- departureS
- soc, available, chargerDone → permit
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.jsjs/charging-scenarios.jsdocs/CHARGING_BLOCKS_SPEC.mdjs/physical-network.jsrust-core/src/charging_control.rs
This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)