Table of Contents

ESS mode 2 and 3

This page explains how to use a Multi/Quattro as a bidirectional inverter operating parallel to the grid, integrated into a customer designed system (PLC, Virtual Power Plant, or other).

The here described functionality builds on top of the normal standalone operation, see ESS manual.

WARNING & DISCLAIMER: whilst publically available, Victron Energy does not offer support in professional customers or end-users that implement features using the here documented functionality, except in real specific situations.

1. Overview of ESS operating modes

1.1 - Mode 1

The system runs automatically, and uses excess energy harvested during the day to fill the gaps when there is not enough PV power available. Typically in the evening and night. Easy configuration in Assistants and on the GX device. For details refer to the ESS manual.

1.2 - Mode 2

Same as Mode 1, but with added custom control doing time shifting, load management or other energy management optimization algorithms. The required components in the system, as well as the general software setup, is 100% equal to the default, Mode 1. The available control points are:

There are various ways to access those control points. Including ModbusTCP, MQTT - either locally or remotely through our secure connection, as well as other means.

1.3 - Mode 3

Customer self implements their control loop and grid measurements, and uses the MultiPlus and/or Quattros as simple, remote controllable, bidirectional inverter/chargers that can be set to either charge or discharge an x amount of Watts. Note that the point of control is the AC-input, not the inverter/charger itself.

Power to/from AC-input = Power to/from battery + Power to/from AC-output

Necessary Victron equipment:

Available control points include the switch (on, charger-only, inverter-only, off), a power setpoint in Watts: regulates the power on the ac-input, and more. Similar to Mode 2, there are various ways to access those control points. Refer to the detailed section below.

Mode 3 with a managed battery

When using Mode 3 with a managed battery, please note that the maximum discharge current sent by the battery will be ignored. The implemented control loop should take care of discharge limits communicated by the battery.

The maximum charge current sent by a managed battery is however always heeded and cannot be overruled by the setpoint.

2. Mode 2 in detail

2.1 Available control points

Please note that the power setpoint register changed in Venus 3.50. Prior to Venus 3.50, the power setpoint would be written to register 2700 or 2703 instead. While this is still supported, it is recommended that future implementations use the 32-bit setting at registers 2716 and 2717 to avoid constantly logging the new setpoint to VRM, and wearing the flash on the GX-device with repeated writes.

a) Grid power setpoint - Modbus-TCP register 2716

For venus versions before 3.50, use register 2700 instead.

b) Enable/Disable charge - Modbus-TCP register 2701 (deprecated in favour of 2705)

Notes:

c) Enable/Disable inverter - Modbus-TCP register 2702 (deprecated in favour of 2704)

Notes:

d) Maximum inverter power - Modbus-TCP register 2704

e) DVCC maximum system charge current - Modbus-TCP register 2705

f) Maximum system grid feed-in - Modbus-TCP register 2706

g) Feed excess DC-coupled PV into the grid - Modbus-TCP register 2707

h) Feed excess AC-coupled PV into the grid - Modbus-TCP register 2708

Please note that for historical reasons this register is inverted compared to 2707.

i) Grid limiting status - Modbus-TCP register 2709

When feed-in of excess AC-coupled PV is disabled, or when a limit is set in register 2706, limiting will be active.

2.2 Accessing the control points

A) Via ModbusTCP

See above mentioned register numbers. Use ModbusTCP unitid 100.

B) Via MQTT

For more information, see the developer mailing list as well as the mqtt github repo.

MQTT is available both on the local broker on the GX device, as well as remotely through the secure cloud connection.

C) Running your own scripts on the GX device

Start reading here.

The ESS related D-Bus paths are:

Note that the MaxChargePercentage and MaxDischargePercentage paths are represented as percentage, but should be used as on/off switch (0: off, 100: on).

2.3 Background

In Mode 1, standalone operation, the ESS control system tries to keep the power flowing through the grid meter at 0 Watt (so no power is taken in from the grid, nor is any power fed back to the grid). Mode 2 means you actively control the target for the grid power. Setting the target to 100 Watt means that the system tries to take 100 Watt from the grid. The power will be used to feed the loads or charge the battery. Similar, a negative value will instruct the system to feed back power to the grid. This will be PV power when possible, otherwise the battery will be discharged. Reset the setpoint back to 0 Watt, and you are back in standard mode again.

In addition you can also control battery charge and discharge. This allows you to control when the battery is charged and discharged.

2.4 Notes

3. Mode 3 in detail

3.1 Operation

Mode 3 means you take direct control of the Multi itself by setting the power it should take/feed back on its AC input. It allows for full control of the inverter/charger and the power from- and to the battery. The power flowing to the batter (or more precise: to DC system attached to the Multi) is equal to the AC-In power minus the AC-Out power. In Mode 3 you have to create your own control loop, and update the set-point frequently.

3.2 Using ModbusTCP

Use unit-id 246, which corresponds with the CCGX VE.Bus port. On a Venus-GX, use unit-id 242 instead.

a) Grid power setpoint - Modbus-TCP registers 37, 40 and 41

b) Disable Charge - Modbus-TCP register 38

c) Disable Feed-in - Modbus-TCP register 39

d) Disable overvoltage Feed-in - Modbus-TCP register 65

Overvoltage feed-in can be used to feed excess DC-tied PV into the grid. Note that DVCC needs to be enabled to properly use this feature.

e) Maximum Feed-in power due to overvoltage - Modbus-TCP register 66 to 68

When overvoltage feed-in is enabled, these registers can be used to limit how much power is fed in. To disable the limit, write a large number to the register.

f) Power Setpoints acts as limit - Modbus-TCP register 71

When this register is set to 1, the Multi will feed in overvoltage up to the value in registers 37, 40 and 41. This is useful when powering loads with excess DC-coupled PV, while still keeping the batteries fully charged. The Power setpoints are then set to match the loads as normal, but the Multi will feed in only excess PV and not energy from the batteries.

g) Overvoltage offset - Modbus-TCP register 72

When feeding excess DC-coupled PV to loads or into the grid, the Multi has two possible settings. It can either add a 1V offset to the solar charger charge voltage, or a 100mV offset. These values are for a 12V setup, and must be multiplied by 2 or 4 for a 24V or 48V setup respectively.

The larger 1V setting is a legacy setting and is now discouraged. When using ESS mode 3 with the overvoltage feed-in feature, it is recommended that you set this register to 1, which will use the lower 100mV offset.

3.3 Running software on the GX device and using DBus paths

When controlling the Multi using software running on the GX device, you should set Settings→ESS→Mode to external control. The following dbus paths can then be adjusted on the com.victronenergy.vebus.ttyO1 service.

a) Grid Power Setpoints - /Hub4/Lx/AcPowerSetpoint

b) Disable charger - /Hub4/DisableCharge

c) Disable Feed-in - /Hub4/DisabledFeedIn

3.4 How it works

3.5 Miscellaneous Notes

3.6 Using the MK3 directly instead of via GX device

3.6.1 Introduction

In this setup, it is not necessary to use a GX device for the control interface. Instead an MK3 is used. We have both MK2-RS232 and an MK3-USB available, see the pricelist.

The MK3-USB has replaced the MK2-USB. There are no differences in the protocol.

A direct connection to the VE.Bus RS485, without MK3 or GX device, is not possible.

Note that, as also indicated on the Data Communication whitepaper, the MK2/3 protocol is not an easy protocol. That is unfortunate, but it is what it is. We cannot give support on it unless there is a huge commercial value behind the project, read thousands of Multis or Quattros.

Finally, also note that when using the MK3 directly, the values are inverted from discussed above: A negative value takes power from the grid, and a positive value feeds power into the grid.

And now, after all the warnings, the information:

3.6.2 Working with RAM IDs to address Assistants

Use RAM ID 128 and higher. Every RAM ID is a word (2 bytes)

The assistant RAM will be filled from ID 128 with ‘assistant RAM records’. Each record starts with a word that contains the AssistantID and the size of the record, and then a number of AssistantRAM words.

RAM ID contents
128 ID_Size (1st Assistant)
129 1st AssistantRAM0
130 1st AssistantRAM1
RAMn 1st AssistantRAMn
RAMn+1 ID_Size (2nd Assistant in this VE.Bus device, if any)
RAMn+2 2nd AssistantRAM0
RAMn+3 2nd AssistantRAM1
etcetera

The ID_Size word contains 0xZZZY, where:

So you have to scan the Assistant RAM records by looking at each ID_size record.

3.6.3 ESS Assistant RAM IDs

The RAM ids of the ESS Assistant are:

Above information is an addendum to the 'Interfacing with VE.Bus products' document. Available from our whitepapers.

3.6.4 EXAMPLE

Note

For the examples to work, the Multi to talk to should be selected using the 'A' command first. See paragraph 7.1 of the 'Interfacing with VE.Bus products. The phase master in L1 can be selected through address 0. To access the phase master for L2 and L3, address 1 and 2 should be selected respectively.

A communication example (assumed is that the ESS assistant is the 1st assistant in the assistant list using AssistantRAM. So this means that the ID_Size is at RamID 128.)

Reading the Assistant ID and Size in the RAM-ID table:

This uses the CommandReadRAMVar command, 0x30:

→ 0x05, 0xFF, 0x57, 0x30, 0x80, 0x00*, 0xF5
(Length, 0xFF, ‘W’, 0x30, Lo(ID), Hi(ID), Checksum)

Response:
← 0x07, 0xFF, 0x57, 0x85, 0x32, 0x00, 0x52, 0x5A, 0x40
(Length, 0xFF, ‘W’, 0x85, Lo(ValueA), Hi(ValueA), Lo(ValueB)*, Hi(ValueB)*, Checksum)

ValueA is the contents of RAMID 128. In this example it is 0x0032 which indicates AssistantID = 3 with 2 extra RAMIDs. (3 is the ID of HUB-4 which is the predecessor of the ESS assistant)

*) Please note that you will get an extra ValueB. This is a feature of newer Multi firmware versions. Because the IDs range from 0..255 the Hi(ID) field would always be 0. Newer Multi firmwares allow you to specify a second ID in this field. So in this case ValueB is the value of RAMID 0 because the 0x00 is interpreted as the second ID. RAMID 0 corresponds with UMains (This can be found in paragraph 7.3.11 of the 'Interfacing with VE.Bus products' document.) So in this example the UMains value is 0x5A52 ⇒ 231.22V NOTE: You will always get a ValueB in the response. You can make handy use of this by reading an extra RAMID or you can ignore it if you don’t need it.

Writing the set point with +200 Watt:

This uses the CommandWriteRAMVar command, 0x32:

We should write RAM ID 129 to +200. Writing requires 2 frames, one frame specifying the ID to write and one frame specifying the data to write.

→ 0x05, 0xFF, 0x57, 0x32, 0x81, 0x00, 0xF2
(0x32=Command Write RAMID, 81 00 = 129, Note that 2nd byte will always be 0 in this command)

→ 0x05, 0xFF, 0x57, 0x34, 0xC8, 0x00, 0xA9
(0x34=Command Write Data, C8 00 = 200)
Note: If a negative set point is needed you should specify this as the 2’s complement value so for example -200W must be specified as 0xFF38 (=65536-200) so that would result in: → 0x05, 0xFF, 0x57, 0x34, 0x38, 0xFF, 0x3A

Response:
← 0x05, 0xFF, 0x57, 0x87, 0x00, 0x00, 0x1E Write OK (87 means successful. Just ignore the rest of the frame (00,00 in this case))

Please refer to the 'Interfacing with VE.Bus products' document, available from our whitepapers, for more info on communicating with the MK3 in general, and more specifically the CommandReadRAMVar and CommandWriteRAMVar commands.

4. Combining ESS with Lithium batteries

5. Response times and ramp speed

There are multiple factors that determine the response time to a (digital-) command to feed in:

  1. Latency and communication speed of all components in the communication chain: ModbusTCP or MQTT, GX Device, MK3 microprocessor, ESS Assistant, internal communication in the Multi itself.
  2. Rate limiting imposed by the used Country Grid code. Code “Other” has no rate limiting, Code “Europe” allows installer configurable rate limiting, many other codes have fixed a powerup ramp up.
  3. Hard coded rate limiting in the inverter/charger firmware: as per ESS version 162 it is set to 400W per second. The reason for this rate limiter is that without that there are regulation problems (overloads and such) when the mains is weak (long cables and such resulting in a relatively high impedance). More information on that here, as well as in the main ESS manual.

6. Further examples for external control

In this section a number of examples for external control is discussed. For these examples to work, you must set the ESS mode to “External control”. This will cause the Multi to go into passthru until it receives an instruction from an external source.

When using Modbus-TCP, note that the unit-id for the CCGX is 246, and for the Venus-GX is 242. These examples only show the paths and registers for a single-phase system. There are paths and registers for the setpoint of other phases too. Refer to the document Modbus-TCP register-list that can be downloaded from the main website for more information about this.

6.1. Disabling all charge and discharge

You may want to put the Multi into what could be called an idle mode, where it is neither charging nor discharging the battery.

6.1.1. Using Dbus

On the vebus service, set as follows. This will put the Multi into passthru.

  /Hub4/DisableFeedIn = 1
  /Hub4/DisableCharge = 1

6.1.2. Using Modbus-TCP

6.2. Tell the Multi to charge the batteries

These instructions tell the Multi to charge at 32kw. Note that the Multi will only charge as much as it is allowed to by its maximum charge current setting as well as any parameters set by a BMS, in other words, it does the best that it can.

Note that the AcPowerSetpoint value has to be written at least once every 60 seconds.

6.2.1. Using Dbus

  /Hub4/DisableFeedIn = 1
  /Hub4/DisableCharge = 0
  /Hub4/Lx/AcPowerSetpoint = 32700

6.2.2. Using Modbus-TCP

6.3. Tell the Multi to discharge the batteries

Note that the AcPowerSetpoint value has to be written at least once every 60 seconds. The point of control is at the AC-input of the Multi. If there are loads on the output, your control loop needs to compensate for that.

6.3.1. Using Dbus

  /Hub4/DisableFeedIn = 0
  /Hub4/DisableCharge = 0
  /Hub4/Lx/AcPowerSetpoint = -1000

You can set the AcPowerSetpoint to any desired value. If this value is higher than the maximum capacity of the Multi, it will discharge at the maximum capacity.

6.3.2. Using Modbus-TCP