> For the complete documentation index, see [llms.txt](https://docs.voltmasters.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.voltmasters.io/control-algorithms/ev-charging.md).

# EV charging

The EMS controls your **EV chargers** alongside the battery and solar. Its aim is to give the cars **as much power as they can take** while keeping the whole site within your **grid connection limit**, and to give EV charging **priority over the battery**. The battery is never charged at the expense of the cars, and it will even **discharge to help power the cars** when they want more than the grid alone can supply.

EV charging behaves the same way whether the site runs [cost optimization](/control-algorithms/cost-optimization.md) or [self-supply](/control-algorithms/self-supply.md).

## The cars come first

Within the grid connection limit, available power is shared in a fixed order:

```mermaid
flowchart TD
    A["Grid connection limit"] --> B["1 · The site's own consumption"]
    B --> C["2 · EV charging: from the grid"]
    C --> D["3 · EV charging: extra power from the battery"]
    D --> E["4 · Charging the battery: only what is left over"]
```

So the battery and the cars never compete for the grid. The battery charges from whatever the cars leave free, and when the cars need more than the grid can deliver, it **discharges to make up the difference**.

## How much power the cars can get

At every moment the EMS works out how much power is available for EV charging. It is the grid connection limit, **plus** what the battery can add by discharging, **minus** whatever the rest of the site is consuming (solar production reduces that consumption, so sunshine leaves more room for the cars).

That total comes in two parts:

* **What the grid can give**: available **straight away**.
* **What the battery can add** on top: phased in **gradually** (see below).

A few things worth knowing:

* The cars get this power **regardless of what the battery is doing** at that instant. EV priority is built in, not a balancing act.
* As a battery gets close to empty it can deliver less power, so the extra room it adds for the cars shrinks on its own.
* If the rest of the site is already using everything the grid and battery can supply, there is no room left for EV charging.

## Ramping up smoothly

When the cars start needing battery power on top of the grid, the EMS does not jump straight to the maximum. The battery needs a few seconds to ramp its output up, and releasing the extra car power before the battery is ready would briefly push the site over its grid limit. So:

* The part the **grid** can supply is given **immediately**.
* The extra part the **battery** supplies is raised **gradually, in small steps**, so the battery can keep up without overshooting the grid limit.
* If less power becomes available (the battery runs low, or site consumption rises), the cars' limit is lowered **immediately** to stay safe.
* The cars are never limited below what they are already drawing.

## When several cars charge at once

The available power is shared between the **active charging sessions**. You can give connectors a **priority** so higher-priority sessions are served first; sessions of equal priority share the available power between them. Each charger is also limited by its own hardware rating.

{% hint style="info" %}
The power the EMS allows a charger is a **ceiling**: the most the car is *allowed* to draw, not a target. A nearly-full car that only draws a few kilowatts simply keeps its high ceiling; this is harmless, because the battery only ever helps with the power the car is **actually** drawing.
{% endhint %}

## Example: a second car arrives

Grid connection limit 400 kW, a battery that can deliver 400 kW, and no other consumption on site. One car starts charging; a second starts two minutes later at another station; the first stops a few minutes after that. Both cars can take 400 kW.

| Moment                | Car A  | Car B  | From the grid | From the battery |
| --------------------- | ------ | ------ | ------------- | ---------------- |
| Car A starts          | 400 kW | –      | 400 kW        | 0                |
| Car B starts          | 200 kW | 200 kW | 400 kW        | 0                |
| …a short while later… | rising | rising | 400 kW        | rising           |
| Both ramped up        | 400 kW | 400 kW | 400 kW        | 400 kW           |
| Car A stops           | –      | 400 kW | 400 kW        | 0                |

The first car gets its full 400 kW straight from the grid. When the second car arrives, the grid can feed both only at 200 kW each at that instant, so they share, and then the battery ramps up over the next minute or two to lift both back to 400 kW. When the first car leaves, the grid alone covers the second car again and the battery stops discharging, without ever interrupting the second car.

## Staying within the grid limit

The EMS continuously checks the **measured** power at the grid connection and trims the cars' power if reality drifts over the limit, for example because of a brief measurement delay or a charger that is slow to follow. In normal operation the gradual ramp keeps the site at the limit on its own, so this only steps in on short transients.

## Settings that affect EV charging

| Setting                    | What it does                                                                                   |
| -------------------------- | ---------------------------------------------------------------------------------------------- |
| **Grid connection limit**  | The ceiling the whole site — cars, consumption and battery charging together — must stay under |
| **Connector priority**     | Which charging sessions are served first when power is tight                                   |
| **EV power-boost reserve** | Battery energy set aside so it stays available to help power the cars                          |

## Relationship to the control strategies

EV charging works the same way under [cost optimization](/control-algorithms/cost-optimization.md) and [self-supply](/control-algorithms/self-supply.md): the cars are always served first, and the battery's own charging takes only what the cars leave free. For the chargers the EMS supports, see [EV chargers](/device-integrations/ev-chargers.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.voltmasters.io/control-algorithms/ev-charging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
