{
  "node": {
    "id": "block:charging-policy",
    "type": "Block",
    "label": "Charging schedule and target policy",
    "properties": {
      "id": "charging-policy",
      "name": "Charging schedule and target policy",
      "kind": "studio",
      "summary": "Sampled permission, current and power requests for an explicit charging target.",
      "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.",
      "ports": [
        {
          "name": "soc",
          "direction": "input",
          "unit": "fraction",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "connected",
          "direction": "input",
          "unit": "dimensionless",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "available",
          "direction": "input",
          "unit": "dimensionless",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "bmsPermit",
          "direction": "input",
          "unit": "dimensionless",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "temperature",
          "direction": "input",
          "unit": "K",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "sitePower",
          "direction": "input",
          "unit": "W",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "chargerDone",
          "direction": "input",
          "unit": "dimensionless",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "permit",
          "direction": "output",
          "unit": "0 or 1",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "requestPower",
          "direction": "output",
          "unit": "W",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "currentCap",
          "direction": "output",
          "unit": "A",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "price",
          "direction": "output",
          "unit": "currency/kWh",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "state",
          "direction": "output",
          "unit": "code",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "reason",
          "direction": "output",
          "unit": "code",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "shortfallJ",
          "direction": "output",
          "unit": "J",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "departureShortfallJ",
          "direction": "output",
          "unit": "J",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "targetSoc",
          "direction": "output",
          "unit": "fraction",
          "description": "Observed result from the solved component or sampled controller."
        }
      ],
      "parameters": [
        {
          "key": "sampleTimeS",
          "label": "Sample Time S",
          "unit": "s",
          "default": 1,
          "min": 0.001,
          "max": 3600,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "strategy",
          "label": "Strategy",
          "unit": "0 immediate, 1 scheduled, 2 opportunity, 3 maintenance",
          "default": 1,
          "min": 0,
          "max": 3,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "chemistry",
          "label": "Chemistry",
          "unit": "0 Li-ion, 1 lead-acid",
          "default": 0,
          "min": 0,
          "max": 1,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "targetSoc",
          "label": "Target Soc",
          "unit": "fraction",
          "default": 0.8,
          "min": 0,
          "max": 1,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "restartSoc",
          "label": "Restart Soc",
          "unit": "fraction",
          "default": 0.7,
          "min": 0,
          "max": 1,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "departureS",
          "label": "Departure S",
          "unit": "s (0 disables departure)",
          "default": 86400,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "maxPowerW",
          "label": "Max Power W",
          "unit": "W grid-side",
          "default": 7000,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "maxCurrentA",
          "label": "Max Current A",
          "unit": "A",
          "default": 32,
          "min": 0,
          "max": 1000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "capacityAh",
          "label": "Capacity Ah",
          "unit": "Ah",
          "default": 100,
          "min": 1e-06,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "nominalVoltageV",
          "label": "Nominal Voltage V",
          "unit": "V",
          "default": 350,
          "min": 0.01,
          "max": 1000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "minTemperatureK",
          "label": "Min Temperature K",
          "unit": "K",
          "default": 273.15,
          "min": 1,
          "max": 1000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "maxTemperatureK",
          "label": "Max Temperature K",
          "unit": "K",
          "default": 318.15,
          "min": 1,
          "max": 1000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "pricePerKWh",
          "label": "Price Per KWh",
          "unit": "currency/kWh",
          "default": 0.2,
          "min": 0,
          "max": 1000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "startS",
          "label": "Start S",
          "unit": "s",
          "default": 0,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "endS",
          "label": "End S",
          "unit": "s",
          "default": 86400,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "repeatPeriodS",
          "label": "Repeat Period S",
          "unit": "s (0 absolute)",
          "default": 0,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        }
      ],
      "equations": [],
      "example": {
        "title": "Build CC–CV charging",
        "text": "An illustrative 100 Ah battery with a 420 V ceiling can use a 32 A cap. At the ceiling, current falls as OCV rises.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-home",
        "label": "Open the Studio example"
      },
      "limits": [
        "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."
      ],
      "evidence": [
        "js/charging-control.js",
        "js/charging-scenarios.js",
        "docs/CHARGING_BLOCKS_SPEC.md",
        "js/physical-network.js",
        "rust-core/src/charging_control.rs"
      ],
      "caseIds": [
        "cccv",
        "home-schedule",
        "depot-allocation",
        "opportunity-window",
        "low-current-maintenance"
      ],
      "type": "charging-policy",
      "implementationId": "charging-policy",
      "url": "https://lemonergy.com/learn/glossary/blocks/charging-policy/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/charging-policy/",
      "sourceFile": "block-library.json",
      "sourceRepository": "battery-design",
      "sourceRevision": "ef9802329b75bc15bb96885f8ed5d49425106696",
      "reviewed": "2026-10-27"
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/cccv/0",
      "type": "usesBlock",
      "source": "workflow:cccv",
      "target": "block:charging-policy",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Charging schedule and target policy",
        "type": "charging-policy",
        "role": "Permits charging",
        "settings": [
          "strategy",
          "targetSoc",
          "departureS",
          "soc, available, chargerDone → permit"
        ]
      }
    },
    {
      "id": "edge:usesBlock/depot-allocation/1",
      "type": "usesBlock",
      "source": "workflow:depot-allocation",
      "target": "block:charging-policy",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 1,
        "name": "Charging schedule and target policy",
        "type": "charging-policy",
        "role": "Permits charging",
        "settings": [
          "strategy",
          "targetSoc",
          "departureS",
          "soc, available, chargerDone → permit"
        ]
      }
    },
    {
      "id": "edge:usesBlock/home-schedule/0",
      "type": "usesBlock",
      "source": "workflow:home-schedule",
      "target": "block:charging-policy",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Charging schedule and target policy",
        "type": "charging-policy",
        "role": "Permits charging",
        "settings": [
          "strategy",
          "targetSoc",
          "departureS",
          "soc, available, chargerDone → permit"
        ]
      }
    },
    {
      "id": "edge:usesBlock/low-current-maintenance/1",
      "type": "usesBlock",
      "source": "workflow:low-current-maintenance",
      "target": "block:charging-policy",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 1,
        "name": "Charging schedule and target policy",
        "type": "charging-policy",
        "role": "Permits charging",
        "settings": [
          "strategy",
          "targetSoc",
          "departureS",
          "soc, available, chargerDone → permit"
        ]
      }
    },
    {
      "id": "edge:usesBlock/opportunity-window/1",
      "type": "usesBlock",
      "source": "workflow:opportunity-window",
      "target": "block:charging-policy",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 1,
        "name": "Charging schedule and target policy",
        "type": "charging-policy",
        "role": "Permits charging",
        "settings": [
          "strategy",
          "targetSoc",
          "departureS",
          "soc, available, chargerDone → permit"
        ]
      }
    }
  ],
  "neighbors": [
    {
      "id": "workflow:cccv",
      "type": "Workflow",
      "label": "Build CC–CV charging",
      "properties": {
        "id": "cccv",
        "title": "Build CC–CV charging",
        "kind": "studio",
        "summary": "Native current and voltage regulation act against an explicit battery.",
        "steps": [
          "Open home charging and inspect settings.",
          "Choose immediate charging; inspect mode and completion."
        ],
        "example": "An illustrative 100 Ah battery with a 420 V ceiling can use a 32 A cap. At the ceiling, current falls as OCV rises.",
        "observe": "Completion needs current below cutoff at the CV ceiling for the configured dwell. Site-limited low current is different.",
        "limits": "The battery uses linear OCV and fixed resistance. It does not automatically add aging, thermal dynamics or balancing.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-home",
        "label": "Open the Studio example",
        "evidence": [
          "js/charging-control.js",
          "js/charging-scenarios.js",
          "docs/CHARGING_BLOCKS_SPEC.md"
        ]
      }
    },
    {
      "id": "workflow:depot-allocation",
      "type": "Workflow",
      "label": "Share a site supply",
      "properties": {
        "id": "depot-allocation",
        "title": "Share a site supply",
        "kind": "studio",
        "summary": "Multiple branches share one power cap.",
        "steps": [
          "Compare proportional and input-priority allocation.",
          "Lower the cap at fixed departure times."
        ],
        "example": "Three vehicles requesting 11 kW each under a 22 kW cap initially receive 7.33 kW each with proportional allocation.",
        "observe": "The site cap can hold while a vehicle misses its target.",
        "limits": "Downstream unused capacity is not silently redistributed.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-depot",
        "label": "Open the Studio example",
        "evidence": [
          "js/charging-control.js",
          "js/charging-scenarios.js",
          "docs/CHARGING_BLOCKS_SPEC.md"
        ]
      }
    },
    {
      "id": "workflow:home-schedule",
      "type": "Workflow",
      "label": "Compare charging policies",
      "properties": {
        "id": "home-schedule",
        "title": "Compare charging policies",
        "kind": "studio",
        "summary": "Compare authored schedules on the same hardware.",
        "steps": [
          "Set connection, tariff, window and target.",
          "Compare policies on this network."
        ],
        "example": "Connect a vehicle for eight hours with a cheaper window from hour 1 to hour 7.",
        "observe": "Compare cost, peak power and departure shortfall.",
        "limits": "This is deterministic policy comparison, not a forecast or economic optimum.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-home",
        "label": "Open the Studio example",
        "evidence": [
          "js/charging-control.js",
          "js/charging-scenarios.js",
          "docs/CHARGING_BLOCKS_SPEC.md"
        ]
      }
    },
    {
      "id": "workflow:low-current-maintenance",
      "type": "Workflow",
      "label": "Separate low current from float",
      "properties": {
        "id": "low-current-maintenance",
        "title": "Separate low current from float",
        "kind": "studio",
        "summary": "Bounded lithium charging and lead-acid maintenance are distinct.",
        "steps": [
          "Inspect the explicit chemistry setting.",
          "Observe CV taper followed by lower float voltage."
        ],
        "example": "The authored lead-acid example uses 14.4 V charging and 13.6 V float ceilings to expose different states.",
        "observe": "Precharge, completion and maintenance are different.",
        "limits": "These effective parameters are not a recipe. Lithium-ion does not use indefinite trickle or lead-acid float.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-maintenance",
        "label": "Open the Studio example",
        "evidence": [
          "js/charging-control.js",
          "js/charging-scenarios.js",
          "docs/CHARGING_BLOCKS_SPEC.md"
        ]
      }
    },
    {
      "id": "workflow:opportunity-window",
      "type": "Workflow",
      "label": "Charge during available stops",
      "properties": {
        "id": "opportunity-window",
        "title": "Charge during available stops",
        "kind": "studio",
        "summary": "Availability is an independent signal.",
        "steps": [
          "Inspect availability and preferred windows.",
          "Shorten a stop."
        ],
        "example": "A 15-minute stop at a 100 kW grid cap has a 25 kWh upper grid-energy bound before losses and battery limits.",
        "observe": "More power cannot recover disconnected time.",
        "limits": "All battery and converter limits still apply. A schedule is not an electrochemical law.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-opportunity",
        "label": "Open the Studio example",
        "evidence": [
          "js/charging-control.js",
          "js/charging-scenarios.js",
          "docs/CHARGING_BLOCKS_SPEC.md"
        ]
      }
    }
  ]
}
