Truck Depot Charging: Grid, Battery Buffer and Schedule
Optimize truck charging against a limited grid connection. Size the battery buffer, compare EDF scheduling, and check every departure SOC and demand charge.
Plan a truck depot charging schedule while a grid upgrade is delayed. This calculator helps fleet engineers, energy managers and students compare a larger connection with a battery buffer, using each truck’s arrival, departure and required state of charge. It suits a depot with several connected trucks and power sharing across megawatt charging equipment.
Start with the truck timetable. Each truck has an editable row: choose Own values to enter elapsed arrival and departure hours, usable battery capacity, arrival SOC, required SOC and DC acceptance power. Enter SOC as a fraction, such as 0.8 for 80%. Times run from the beginning of the planning horizon, so an overnight shift can use continuous elapsed hours. The supplied six-truck timetable is a synthetic planning example.
Set the grid import limit, other site load, shared DC charging capacity and power available at each plug. The charging curve stays at its plateau until the selected SOC knee and then tapers linearly. Each command is held throughout its slot and remains below the acceptance curve at the resulting end SOC. Replace those assumptions with vehicle or fleet measurements when available. Charger nameplate power alone does not determine how much energy a truck can take during a short stop.
The electric truck charging schedule optimization first maximizes energy delivered before departure, then minimizes the modeled monthly energy and demand bill without giving back delivered energy. The full horizon includes BESS charging, discharging, conversion losses, converter power and SOC limits. An independent vehicle ODE replay verifies the resulting commands. Leave Restore initial BESS SOC enabled for repeatable operation; disabling it represents a one-off shift that can consume the initial stored energy.
Read each truck’s departure SOC and energy shortfall before comparing costs. The dispatch tables give constant DC truck commands and signed AC BESS power: positive means discharge. Only trucks with a nonzero command appear in the narrow setpoint list. The playback cursor follows the charging allocation and battery state. Earliest-deadline-first provides a simple baseline that replenishes its initial battery reserve whenever grid headroom permits.
The grid connection battery sweep compares nine infrastructure options. The separate minimum-capacity search finds a nominal BESS energy bracket for those held commands, at the selected grid limit and converter rating. That minimum meets departures; the installed battery can be larger to reduce demand charges. If the search ceiling cannot supply the fleet, more battery energy may be ineffective when charging power or dwell time is the binding limit.
Prices are editable illustrative USD assumptions dated 2 November 2026. Monthly energy costs cover the stated number of modeled horizons; demand charges use the largest modeled slot-average import. The 18-month result repeats that bill without escalation. These figures exclude equipment, installation, financing, degradation replacement, off-horizon energy and tariff ratchets.
This depot BESS sizing model does not design transformers, protection, cables or connector cooling. Smaller command intervals reduce conservatism for short stops; continuously varying control can require less storage. Dedicated connected plugs are assumed; it does not optimize truck movements or queues. Installation work belongs to a qualified person, and equipment must be checked against the standard in force.
How it is calculated
Each truck and the BESS receive constant power commands for each scheduling slot, 15 minutes by default. SOC then changes linearly while a command is realizable. For the entered nonincreasing acceptance curve,
For truck energy in a slot of duration , the LP imposes both
Here . The second constraint is linear in cumulative delivered energy. Because acceptance decreases with SOC, satisfying it at the end proves that the constant command is accepted throughout the slot. This avoids combining a full-power charging integral with a smaller available grid power.
The full-horizon LP simultaneously enforces truck availability and target SOC, shared DC cabinet power, the AC grid limit and absolute peak, no export, BESS charge/discharge converter power, and cumulative stored-energy bounds. Since all these commands are constant and BESS energy is linear within a slot, the constraints apply throughout that slot. A first simplex solve maximizes total delivered truck energy. A second fixes that total and minimizes monthly energy and demand charges, with a USD 0.001/kWh AC-storage-throughput regularizer. If the fleet is infeasible, this minimizes total shortfall without promising equal or priority-weighted service.
The AC balance is ; storage evolves as . Cyclic mode restores at least the initial stored energy. One-off mode can use the BESS to supply a base load above the grid limit, provided the converter and initial usable energy can cover the entire base-load deficit. The initial LP basis explicitly includes that supporting discharge.
An independent RK4 replay integrates , checking the actual truck energy and grid, cabinet, converter and storage limits at its stages. A failed replay blocks results. The separate EDF controller uses the same realizable constant-command acceptance bound and reserves storage for future base-load deficits.
The 3 × 3 sweep warm-starts the same LP. Each option first checks base-load supply; an infeasible option is marked individually. The capacity search uses LP sensitivity to bracket the least nominal BESS energy for the entered command interval, power and terminal policy. The reported bracket is optimization precision, not a physical uncertainty margin.
All solver matrices are explicitly normalized by 1 h, 1 kW and 1 kWh. Independent SciPy 1.15.3/HiGHS record s7 replaces the former integral-envelope record s6, and independently integrates the review counterexample. Context ratings from bp pulse, ASKO and Alfredsson describe different grid, DC charger and BESS power limits; they do not determine storage energy.
Assumptions
The timetable is synthetic and editable, not a measured ASKO or bp pulse operating record. Every active truck has its own available plug; a shared cabinet limits aggregate DC output. Truck usable capacity is fixed. DC charger output is treated as energy entering the usable battery; additional pack losses, temperature limits and auxiliary loads require adjusted acceptance curves or site load.
Other site load and conversion efficiencies are constant. BESS charge and discharge share the stated converter rating. One-way BESS efficiency is applied separately in each direction. There is no PV, export, vehicle-to-grid, outage reserve beyond the minimum SOC, or integer plug assignment.
Default tariff assumptions are USD 0.15/kWh and USD 12/kW/month as a user-editable scenario dated 2026-11-02, not a quoted utility tariff. Monthly demand charges apply once to the modeled peak. The reference cases reproduce ICCT’s nominal 350/750 kW, 45-minute events with losses and taper disabled; they are ideal energy benchmarks, not measurements of MCS performance.
The optimization and EDF comparison both hold each DC setpoint for its entire slot. There are no within-slot power reallocations. The input charging curve is a static upper bound on vehicle acceptance; constant setpoints are constrained at the slot's end SOC.
Where it applies
The result is optimal for the explicitly modeled piecewise constant DC command policy. A continuously varying, acceptance-following controller can deliver more energy and need less storage. Refine the scheduling interval to assess that difference before procurement. In the review's 600 kWh, SOC 0.65→0.94, 15-minute, 700 kW-grid case, the continuous-control ceiling is 162.748 kWh; a held command can deliver only 140 kWh. The calculator reports the resulting 34 kWh shortfall, not a feasible departure.
Availability rounds inward to complete slots and can lose almost two intervals of dwell time. The acceptance constraint uses end SOC and the full entered taper curve; it does not approximate an unavailable full-power trajectory as an average power. Converter ramps, communications delays, cooling and temperature-dependent derating are not modeled. The site controller must implement the stated commands and actual equipment limits.
The default replay uses four RK4 substeps in each charging slot and one exact linear interval for idle slots. Valid constant commands give a constant vehicle derivative, so replay refinement should change only roundoff. Increase replay substeps to diagnose a failed or near-boundary replay; refine the scheduling interval to change the control policy itself. The model's default cost targets about three seconds; finer schedules take longer.
The BESS bracket applies to the entered SOC window, initial SOC, converter power, grid limit and terminal policy. It excludes ageing, forecast uncertainty, temperature derating and procurement margin. If the search ceiling cannot supply all departures, the minimum-capacity result is blank. Sweep cells whose base load cannot be supplied are blank for truck shortfall and explicitly labeled Base unmet; they do not block other options.
Large dimensionless LP tableaux exceed the engine's element-by-element unit audit; physical inputs and energy-accounting summaries retain units. The independent ODE replay and AC energy-balance check verify the recovered dispatch. The cost comparison excludes off-horizon loads/peaks, tariff ratchets, fixed charges, taxes, BESS capital and degradation costs. EDF terminal restoration is reported separately if it needs extra recharge time.
IEC TS 63379:2026, Edition 1.0, supersedes draft-status wording in older summaries. This is energy scheduling rather than connector compliance; check against the standard in force.
References
- ICCT, Charging infrastructure needs for battery electric trucks in the European Union by 2030 (October 2025), Table 5 and charging-pattern assumptions, PDF pp.19–20. https://theicct.org/wp-content/uploads/2025/10/ID-476-%E2%80%93-EU-BETs_report_final-1.pdf
- CharIN, Official publication of IEC TS 63379: A game-changer for Megawatt Charging System standardization (February 2026). https://www.charin.global/news/iec-ts-63379-for-megawatt-charging-system-mcs/
- IEC TS 63379:2026, Edition 1.0, public scope and publication date. https://webstore.iec.ch/en/publication/67975
- Kempower, ASKO Vestby depot installation (16 October 2025): two 1.2 MW power units, 2.4 MW aggregate charging power; this is not a claim about its grid connection. https://investors.kempower.com/releases/kempower-delivers-distributed-megawatt-charging-solution-to-norways-largest-grocery-retailer-askos-depot-in-vestby/
- Kempower, The utilization imperative (2026): Alfredsson depot integration of charging, 1.2 MW BESS and solar. https://kempower.com/the-utilization-imperative-how-shared-depots-and-flexible-charging-will-drive-the-electric-truck-transition/
- Henry Johnson (Alpitronic), public LinkedIn post on bp pulse/Aral MCS rollout (2026): initial grid power 2.5 MW. This operator-specific starting limit is context, not a universal MCS requirement. https://www.linkedin.com/posts/henry-johnson-a6409134_march-marked-a-major-milestone-for-alpitronic-activity-7447594421136678912-W9X0
Inputs
| Input | Symbol | Unit | Default |
|---|---|---|---|
| Number of trucks | N_trucks | 6 | |
| Truck 1 Choose Own values to edit this truck; SOC is a fraction from 0 to 1. | truck_1 | Truck 1 | |
| Truck 2 | truck_2 | Truck 2 | |
| Truck 3 | truck_3 | Truck 3 | |
| Truck 4 | truck_4 | Truck 4 | |
| Truck 5 | truck_5 | Truck 5 | |
| Truck 6 | truck_6 | Truck 6 | |
| Truck 7 | truck_7 | Truck 7 | |
| Truck 8 | truck_8 | Truck 8 | |
| Planning horizon | H_window | h | 6 |
| Grid import limit | P_grid | kW | 800 |
| Other site load | P_base | kW | 100 |
| Shared charger DC capacity | P_cabinet | kW | 2400 |
| Maximum DC power per truck | P_plug | kW | 1200 |
| AC to DC efficiency | eta_charger | 0.95 | |
| Installed nominal BESS energy | B_nom | kWh | 600 |
| BESS AC converter rating | P_bess | kW | 1200 |
| BESS minimum SOC | soc_min | 0.1 | |
| BESS maximum SOC | soc_max | 0.9 | |
| BESS initial SOC | soc_start | 0.6 | |
| BESS one-way efficiency Round-trip efficiency is the square of this value. | eta_bess | 0.95 | |
| Restore initial BESS SOC Enable for a repeating operating horizon; disable for a one-off shift. | cyclic | true | |
| Truck taper starts at SOC | soc_knee | 0.65 | |
| Power fraction at full SOC Power falls linearly from the knee to this fraction of the plateau at SOC 1. | tail_fraction | 0.2 | |
| Energy price (USD/kWh) | energy_rate | 1/kWh | 0.15 |
| Demand price (USD/kW/month) | demand_rate | 1/kW | 12 |
| Operating horizons per month | days_month | 22 | |
| Sweep minimum grid | G_low | kW | 600 |
| Sweep maximum grid | G_high | kW | 1000 |
| BESS search ceiling The minimum-capacity result is bracketed below this ceiling at the selected grid limit. | B_search | kWh | 1200 |
| Scheduling slot Use 0.25 h for 15-minute constant-power commands; shorter slots reduce control-policy conservatism. | dt_slot | h | 0.25 |
| LP pivot limit | pivot_limit | 1500 | |
| Time in depot | t_show | h | 1.4 |
| ODE replay substeps per slot RK4 replays the optimized setpoints against the vehicle acceptance curve. | replay_steps | 4 |
Results
With the default inputs above, the calc gives:
| Result | Value |
|---|---|
| Departure readiness | All departures supplied |
| Sizing feasibility | Capacity bracket found |
| Minimum BESS · slot setpoints | 249.6 kWh |
| Capacity search bracket width | 0.01 kWh |
| Optimized departure shortfall | 0 kWh |
| Optimized site peak | 596 kW |
| Imported energy per horizon | 2,922.9 kWh |
| Monthly demand charge (USD) | 7,152 |
| Monthly electricity cost (USD) | 16,798 |
| 18-month electricity cost (USD) | 302,359 |
| EDF departure shortfall | 0 kWh |
| EDF site peak | 800 kW |
| EDF monthly electricity cost (USD) | 19,313 |
Checked against sources
Each case below was calculated by this calc and agrees with the value from its source (within the tolerance where one is shown).
ICCT 45-minute fast charging event
Source: ICCT, Charging infrastructure needs for battery electric trucks in the EU by 2030 (2025), PDF p.19 Table 5 and 45-minute event assumption. Independent ideal-energy benchmark: 350 kW × 0.75 h = 262.5 kWh. No losses/taper; this checks an ideal nominal event, not measured performance.
Inputs: Number of trucks = 1; Truck 1 = ICCT fast event; Planning horizon = 1 h; Grid import limit = 1,500 kW; Other site load = 0 kW; Shared charger DC capacity = 1,500 kW; AC to DC efficiency = 1; Installed nominal BESS energy = 0 kWh; BESS AC converter rating = 0 kW; Power fraction at full SOC = 1; Sweep minimum grid = 1,000 kW; Sweep maximum grid = 1,500 kW; BESS search ceiling = 100 kWh; Energy price (USD/kWh) = 0 1/kWh; Demand price (USD/kW/month) = 0 1/kW; the others as above.
| Result | Source | This calc |
|---|---|---|
| Energy delivered to trucks | 262.5 kWh | 262.5 kWh |
| Optimized site peak | 350 kW | 350 kW |
ICCT 45-minute ultrafast charging event
Source: ICCT (2025), PDF p.19: nominal MCS rate 750 kW and daily 45-minute opportunity event. Independent ideal-energy benchmark: 750 kW × 0.75 h = 562.5 kWh; no losses/taper. The report's 2025 standard-status wording is superseded by IEC TS 63379:2026.
Inputs: Number of trucks = 1; Truck 1 = ICCT ultrafast event; Planning horizon = 1 h; Grid import limit = 1,500 kW; Other site load = 0 kW; Shared charger DC capacity = 1,500 kW; AC to DC efficiency = 1; Installed nominal BESS energy = 0 kWh; BESS AC converter rating = 0 kW; Power fraction at full SOC = 1; Sweep minimum grid = 1,000 kW; Sweep maximum grid = 1,500 kW; BESS search ceiling = 100 kWh; Energy price (USD/kWh) = 0 1/kWh; Demand price (USD/kW/month) = 0 1/kW; the others as above.
| Result | Source | This calc |
|---|---|---|
| Energy delivered to trucks | 562.5 kWh | 562.5 kWh |
| Optimized site peak | 750 kW | 750 kW |
Independent HiGHS default-fleet optimization
Source: Revised independent SciPy 1.15.3/HiGHS formulation of the constant-setpoint model, attached source s7. Each truck setpoint is constrained by its end-of-slot SOC. The minimum nominal capacity is solved with an explicit LP capacity variable, independently of the calculator's parametric search. Reproduction: .work/truck-depot-charging-bess/crosscheck.py. Supersedes the old integral-envelope benchmark s6.
Inputs: the default inputs above.
| Result | Source | This calc |
|---|---|---|
| Energy delivered to trucks | 2,160 kWh | 2,160 kWh |
| Optimized site peak | 596 kW | 596 kW |
| Minimum BESS · slot setpoints | 249.6 kWh | 249.6 kWh |
| Monthly electricity cost (USD) | 16,798 | 16,798 |
DC cabinet rating survives AC conversion losses
Source: ICCT (2025), PDF p.19 Table 5 gives a 350 kW fast charging rating and a 45-minute event; PDF p.20 states charging efficiency close to 85%. This isolated nominal-rating case assumes constant DC acceptance: 350 kW × 0.75 h = 262.5 kWh into the truck and 262.5/0.85 = 308.823529 kWh from AC. It tests that a DC nameplate is not derated twice; it does not reproduce the report's separate effective-power-utilization factor.
Inputs: Number of trucks = 1; Truck 1 = ICCT fast event; Planning horizon = 1 h; Grid import limit = 1,500 kW; Other site load = 0 kW; Shared charger DC capacity = 350 kW; AC to DC efficiency = 0.85; Installed nominal BESS energy = 0 kWh; BESS AC converter rating = 0 kW; Power fraction at full SOC = 1; Sweep minimum grid = 1,000 kW; Sweep maximum grid = 1,500 kW; BESS search ceiling = 100 kWh; Energy price (USD/kWh) = 0 1/kWh; Demand price (USD/kW/month) = 0 1/kW; the others as above.
| Result | Source | This calc |
|---|---|---|
| Energy delivered to trucks | 262.5 kWh | 262.5 kWh |
| Imported energy per horizon | 308.8 kWh | 308.8 kWh |
Joint grid/taper limit: realizable quarter-hour command
Source: Independent review regression and SciPy verification, source s7. At 700 kW grid power the continuous-control maximum is only 162.7483943 kWh, so the former 174 kWh result was impossible. For the explicitly modeled constant DC command, the exact endpoint acceptance constraint gives 140 kWh and a 34 kWh shortfall. This case checks command realization as well as conservation.
Inputs: Number of trucks = 1; Truck 1 = own values; Planning horizon = 0.25 h; Grid import limit = 700 kW; Other site load = 0 kW; Installed nominal BESS energy = 0 kWh; BESS AC converter rating = 0 kW; AC to DC efficiency = 1; Sweep maximum grid = 800 kW; BESS search ceiling = 100 kWh; the others as above.
| Result | Source | This calc |
|---|---|---|
| Energy delivered to trucks | 140 kWh | 140 kWh |
| Optimized departure shortfall | 34 kWh | 34 kWh |
| Energy delivered in independent ODE replay | 140 kWh | 140 kWh |
| Optimized site peak | 560 kW | 560 kW |
One-off BESS supports a base load above the grid limit
Source: Independent review's one-hour example supplied by the user: grid 100 kW, other site load 200 kW, 600 kWh BESS and 60 kWh DC truck demand. Constructive feasibility: (100 kWh base deficit + 60/0.95 kWh AC charging)/0.95 = 171.745 kWh of stored energy, below the 300 kWh initially available above reserve, with an ample 1200 kW converter. Cyclic restoration is disabled.
Inputs: Number of trucks = 1; Truck 1 = own values; Planning horizon = 1 h; Grid import limit = 100 kW; Other site load = 200 kW; Restore initial BESS SOC = no; Sweep minimum grid = 100 kW; Sweep maximum grid = 300 kW; the others as above.
| Result | Source | This calc |
|---|---|---|
| Energy delivered to trucks | 60 kWh | 60 kWh |
| Optimized departure shortfall | 0 ± 1 × 10⁻⁵ kWh | 0 kWh |
| Main optimization status | 0 | 0 |
| Energy delivered in independent ODE replay | 60 kWh | 60 kWh |
Related Resources
Related articles
-
Digital Control and Thermal Performance Analysis of a Grid-Connected Single-Phase Battery Charger Using Cascaded AC/DC and Phase-Shifted DC/DC Converters in PLECS -
Grid-Connected PV System with Battery Storage: Design, Simulation, and Performance Analysis -
Complete Solar PV System Simulation in Python, Irradiance, MPPT, Battery Storage & Grid Performance Analysis
Related courses
IEC Electrical Schematics and Industrial Control Panels
Basic Electrical Controls & Diagram Reading

Responses