Charger physics · operating policies · energy exchange
Charging strategies and V2X
Connect an editable charger to a battery model, then decide when and how energy may move. Explore the effects of connection windows, site capacity, battery limits and the next departure.
Inspect and run a scenario
Loading model catalog.
| Component | Type | Ports | Inspect |
|---|
Connections and control signal bindings
Selected component parameters
Choose a component to inspect its parameters.
Native results
Run identity and diagnostics
Choose an operating policy
A policy is a reusable control component. The use-case presets assemble it with the battery, charger, meters and any shared power allocator; every component remains editable in Studio.
| Use case | Policy questions | Inspect in the result |
|---|---|---|
| Home | When is the vehicle connected? Which charging window and tariff should apply? | Energy and cost, peak import, SOC at departure and unmet target. |
| Depot | How is a finite site connection divided between vehicles? | Simultaneous demand and allocated power; each battery's readiness. |
| Opportunity | Can short stops deliver enough energy within battery and charger limits? | Active windows, delivered energy and remaining charging shortfall. |
| Bounded low-current charging | How long does a small current take to reach the target? | Current, SOC, delivered energy and termination. Low-voltage precharge is a separate regulator phase. |
| Maintenance | Which chemistry and recharge thresholds are intended? | Lead-acid float or an explicitly bounded recharge cycle; no indefinite post-full lithium-ion trickle. |
| V2G | When may the battery import or export, and what mobility reserve must remain? | Separate import/export energy, conversion losses, tariff ledger and reserve. |
| V2H / V2L | How much building or appliance demand can the battery serve? | Requested and delivered power, delivered energy and remaining SOC. |
| V2V | How much energy can a donor transfer while respecting both batteries? | Donor depletion, recipient gain, current/voltage limits and converter loss. |
Separate regulation from scheduling
Battery → charger → policy → site allocation. Conserving electrical terminals carry voltage and current. Named control signals carry permission, requested power, temperature, SOC and limits. A site allocator bounds simultaneous demand; it does not create energy. A V2V converter joins two electrical networks, so the donor and recipient are both part of the solve.
CC/CV regulation is responsible for the battery-side current, voltage ceiling and taper cutoff. Scheduling is responsible for connection periods, power requests and readiness targets. Keeping these roles separate makes the same charger reusable across a home session, a fleet depot or an energy-export scenario.
Compare policies with the same battery, hardware, initial SOC, availability and tariffs. A cheaper result is not better if it misses the required departure charge. These authored rules are inspectable scheduling policies; they do not claim a globally optimal schedule.
Implementation and test coverage
The model file carries its assumptions and numerical settings. The native engine checksum, model checksum and trace identity accompany each retained run. A browser run executes the same native equations, and its CSV contains all output samples.
What the reference helped us improve
The MathWorks example demonstrates a charger-to-module simulation with current regulation, voltage regulation and current-based termination. We use that visible behavior as a capability benchmark. Lemonergy already had charging architecture, session and V2X planning tools; this work brings those decisions into editable, connected simulation components.
Our extension adds use-case policies, shared site allocation, departure shortfall, bidirectional energy accounting and a two-battery transfer model. These are omissions from the linked example's demonstrated scope, not claims that the wider MathWorks product cannot model them. The equations, code, scenarios, interface and tests here are independently authored for Lemonergy.
Model boundaries
The converters use average power and declared efficiencies. The battery uses a stated reduced electrical model. Temperature and BMS permissions are explicit inputs; a successful run is not a thermal, ageing or hardware certification. Control transitions have the stated sample-time resolution.
V2G, V2H, V2L and V2V presets explore energy flow. They do not implement grid synchronisation, protection coordination, anti-islanding, charger communications or vehicle interoperability. Hardware capability and installation requirements must be established separately. Tariffs and example parameters are authored assumptions, not an electricity offer or a forecast.
Sources and original implementation
Behavioral benchmark: Charge Battery Module with Charger Block and ideal Charger block. Battery limits: charging-current limit inputs. Charge phases and termination: Texas Instruments BQ25629 overview. Chemistry-aware termination: Richtek AN050. Managed and bidirectional charging concepts: U.S. Department of Energy.
No MathWorks source code, model files, diagrams or page text are included. The source download contains the original Lemonergy runtime, native engine, models and the evidence needed to inspect this implementation.