9.6. EvseManager

EVSE Manager. Grid side power meter: Will be used for energy management. Will also be used for billing if no car side power meter connected. Car side powermeter: Will be used for billing if present.

9.6.1. Additional documentation

The module EvseManager is a central module that manages one EVSE (i.e. one connector to charge a car). It may control multiple physical connectors if they are not usable at the same time and share one connector id, but one EvseManager always shows as one connector in OCPP for example. So in general each connector should have a dedicated EvseManager module loaded.

The EvseManager contains the high level charging logic (Basic charging and HLC/SLAC interaction), collects all relevant data for the charging session (e.g. energy delivered during this charging session) and provides control over the charging port/session. For HLC it uses two helper protocol modules that it controls (SLAC and ISO15118).

Protocol modules such as OCPP or other APIs use EvseManagers to control the charging session and get all relevant data.

The following charge modes are supported:

  • AC charging: Basic Charging according to IEC61851/SAE J1772 and HLC according to ISO15118-2

  • DC charging: ISO15118-2 and DIN SPEC 70121

Additional features:

  • Autocharge support (PnC coming soon)

  • Seamlessly integrates into EVerest Energy Management

  • The lowest level IEC61851 state machine can be run on a dedicated microcontroller for improved electrical safety

  • Support for seperate AC and DC side metering in DC application

9.6.1.1. Typical connections

TODO: AC and DC module graphs and description

9.6.1.1.1. AC Configuration

9.6.1.1.2. DC Configuration

In DC applications, the EvseManager still has an AC side that behaves similar to a normal AC charger. The board_support module therefore still has to report AC capabilities which refer to the AC input of the AC/DC power supply. If an AC side RCD is used it also belongs to the board_support driver. An AC side power meter can be connected and it will be used for Energy management.

In addition, on the DC side the following hardware modules can be connected:

  • A DC powermeter: This will be used for billing purposes if present. If not connected, billing will fall back to the AC side power meter.

  • Isolation monitoring: This will be used to monitor isolation during CableCheck, PreCharge and CurrentDemand steps.

  • DC power supply: This is the AC/DC converter that actually charges the car.

9.6.1.2. Published variables

9.6.1.2.1. session_events

EvseManager publishes the session_events variable whenever an event happens. It does not publish its internal state but merely events that happen that can be used to drive an state machine within another module.

Example: Write a simple module that lights up an LED if the evse is reserved. This module requires an EvseManager and subscribes to the session_events variable. Internally it has only two states: Reserved (LED on), NotReserved (LED off).

The state machine transitions are driven by the two events from EvseManager: ReservationStart and ReservationEnd.

All other events are ignored in this module as they are not needed.

9.6.1.2.2. powermeter

EvseManager republishes the power meter struct that if it has a powermeter connected. This struct should be used for OCPP and display purposes. It comes from the power meter that can be used for billing (DC side on DC, AC side on AC). If no powermeter is connected EvseManager will never publish this variable.

9.6.1.3. Authentication

The Auth modules validates tokens and assignes tokens to EvseManagers, see Auth documentation. It will call Authorize(id_tag, pnc) on EvseManager to indicated that the EvseManager may start the charging session. Auth module may revoke authorization (withdraw_authorization command) if the charging session has not begun yet (typically due to timeout), but not once charging has started.

9.6.1.3.1. Autocharge / PnC

Autocharge is fully supported, PnC support is coming soon and will use the same logic. The car itself is a token provider that can provide an auth token to be validated by the Auth system (see Auth documentation for more details). EvseManager provides a token_provider interface for that purpose.

If external identification (EIM) is used in HLC (no PnC) then Autocharge is enabled by connecting the token_provider interface to Auth module. When the car sends its EVCCID in the HLC protocol it is converted to Autocharge format and published as Auth token. It is based on the following specification:

https://github.com/openfastchargingalliance/openfastchargingalliance/blob/master/autocharge-final.pdf

To enable PnC the config option payment_enable_contract must be set to true. If the car selects Contract instead of EIM PnC will be used instead of Autocharge.

9.6.1.3.2. Reservation

Reservation handling logic is implemented in the Auth module. If the Auth module wants to reserve a specific EvseManager (or cancel the reservation) it needs to call the reserve/cancel_reservation commands. EvseManager does not check reservation id against the token id when it should start charging, this must be handled in Auth module. EvseManager only needs to know whether it is reserved or not to emit an ReservatonStart/ReservationEnd event to notify other modules such as OCPP and API or e.g. switch on a specific LED signal on the charging port.

9.6.1.4. Energy Management

EvseManager seamlessly intergrates into the EVerest Energy Management. For further details refer to the documentation of the EnergyManager module.

EvseManager has a grid facing Energy interface which the energy tree uses to provide energy for the charging sessions. New energy needs to be provided on regular intervals (with a timeout).

If the supplied energy limits time out, EvseManager will stop charging. This prevents e.g. overload conditions when the network connection drops between the energy tree and EvseManager.

EvseManager will send out its wishes at regular intervals: It sends a requested energy schedule into the energy tree that is merged from hardware capabilities (as reported by board_support module), EvseManager module configuration settings (max_current, three_phases) and external limts (via set_local_max_current command) e.g. set by OCPP module.

The combined schedule sent to the energy tree is the minimum of all energy limits.

After traversing the energy tree the EnergyManager will use this information to assign limits (and a schedule) for this EvseManager and will call enforce_limits on the energy interface. These values will then be used to configure PWM/DC power supplies to actually charge the car and must not be confused with the original wishes that were sent to the energy tree.

The EvseManager will never assign energy to itself, it always requests energy from the energy manager and only charges if the energy manager responds with an assignment.

The set_local_max_current command will be extended to schedules (and not just one instantaneous limit) soon to fully support schedules from OCPP smart charging profile.

Limits in the energy object can be specified in ampere (per phase) and/or watt. Currently watt limits are unsupported, but it should behave according to that logic:

If both are specified also both limits will be applied, whichever is lower. With DC charging, ampere limits apply to the AC side and watt limits apply to both AC and DC side.

9.6.2. Module Configuration

connector_id:integer
Connector id of this evse manager
evse_id:string
default: DE*PNX*E1234567*1
EVSE ID
evse_id_din:string
default: 49A80737A45678
EVSE ID DIN after DIN SPEC 91286
payment_enable_eim:boolean
default: True
Set to true to enable EIM (e.g. RFID card or mobile app) authorization
payment_enable_contract:boolean
default: True
Set to true to enable contract (aka plug and charge) authorization
ac_nominal_voltage:number
default: 230
Nominal AC voltage between phase and neutral in Volt
ev_receipt_required:boolean
default: False
Unsupported: request receipt from EV with HLC
session_logging:boolean
default: False
Enable/Disable session log file output
session_logging_path:string
default: /tmp
Output directory for session log files
session_logging_xml:boolean
default: True
Log full XML messages for HLC
three_phases:boolean
default: True
Limit to three phases (true) or one phase (false)
has_ventilation:boolean
default: True
Allow ventilated charging or not
country_code:string
default: DE
Country Code
rcd_enabled:boolean
default: True
Enable or disable RCD
max_current_import_A:number
default: 32
User configurable current limit for this EVSE in Ampere
max_current_export_A:number
default: 32
User configurable current limit for this EVSE in Ampere
charge_mode:string
default: AC
Select charging mode
enum: AC, DC
ac_hlc_enabled:boolean
default: False
Enable or disable HLC (aka ISO15118) for AC mode
ac_hlc_use_5percent:boolean
default: False
Use 5 percent PWM signalling to try to enforce HLC on AC. Note that if EIM arrives before SLAC matching, we will fall back to nominal PWM charging. So most cars will never use HLC in this mode, especially on a free service where EIM is always available, but that is what ISO15118-2/-3 requires to be compliant - it wants to use HLC only for PnC and not for EIM.
ac_enforce_hlc:boolean
default: False
Combine with 5percent option to really enforce HLC even with EIM. It is not ISO15118-2/-3 compliant as it waits for matching even if EIM is available before SLAC reaches matched state. On cars that do not support ISO15118 on AC this will take a very long time to timeout and fall back to basic nominal PWM charging, but it will eventually.
ac_with_soc:boolean
default: False
Special mode that switches between AC and DC charging to get SoC percentage with AC charging
dc_isolation_voltage_V:integer
default: 500
DC voltage used to test isolation in CableCheck. Set to 500V.
dbg_hlc_auth_after_tstep:boolean
default: False
Special mode: send HLC auth ok only after t_step_XX is finished (true) or directly when available (false)
hack_sleep_in_cable_check:integer
default: 0
Hack: Sleep for n seconds at the end of cable check.
hack_sleep_in_cable_check_volkswagen:integer
default: 0
Hack: Additional sleep for Volkswagen cars for n seconds at the end of cable check
switch_to_minimum_voltage_after_cable_check:boolean
default: False
When cable check is completed, switch to minimal voltage of DC output. Normally disabled.
hack_skoda_enyaq:boolean
default: False
Skoda Enyaq requests DC charging voltages below its battery level or even below 0 initially. Set to true to enable dirty workaround.
hack_present_current_offset:integer
default: 0
Adds an offset [A] to the present current reported to the car on HLC. Set to 0 unless you really know what you are doing.
connector_type:string
default: IEC62196Type2Cable
Type of charging connector available at this EVSE
enum: IEC62196Type2Cable, IEC62196Type2Socket
hack_pause_imd_during_precharge:boolean
default: False
Disable IMD at the end of CableCheck and re-enable when current is flowing in CurrentDemand. Some DCDC power supplies do not start current flow when insulation measurement is active. Set to true to enable dirty workaround for some IMD hardware.
hack_allow_bpt_with_iso2:boolean
default: False
Hack. Allow bidirectional power transfer with DIN spec and ISO-2. Currents communicated on HLC will always be positive but power supply may actually discharge the car.
autocharge_use_slac_instead_of_hlc:boolean
default: False
Use slac ev mac address for autocharge instead of EVCCID from HLC
logfile_suffix:string
default: session_uuid
Use the string given for the log folder name. Special string session_uuid will be replaced with session uuid.
soft_over_current_tolerance_percent:number
default: 10.0
Allow for N percent over current in soft over current checking during AC charging.
soft_over_current_measurement_noise_A:number
default: 0.5
Set current measurement noise. Added to limit as an offset to avoid false triggers.

9.6.3. Provides

This is the main evsemanager interface
energy_grid:energy
This is the tree leaf interface to build the energy supply tree
token_provider:auth_token_provider
Provides authtokens for autocharge or plug and charge

9.6.4. Requirements

powermeter_grid_side:powermeter
powermeter_car_side:powermeter
slac:slac
powersupply_DC:power_supply_DC

9.6.5. Metadata

9.6.5.1. Authors

Cornelius Claussen
Anton Woellert

9.6.5.2. License