User Tools

Site Tools


system_integration:hub4_grid_parallel_external_control_loop

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
system_integration:hub4_grid_parallel_external_control_loop [2016-03-22 18:11] – [3.3 Using the MK2 directly instead of CCGX] pbasystem_integration:hub4_grid_parallel_external_control_loop [2019-01-22 10:16] (current) – external edit 127.0.0.1
Line 5: Line 5:
 Note that it is also possible to run a Victron grid parallel storage system without designing and implementing your own control loop, logic or measurements. See the  [[system_integration:hub4_grid_parallel|Hub-4 manual]]. Note that it is also possible to run a Victron grid parallel storage system without designing and implementing your own control loop, logic or measurements. See the  [[system_integration:hub4_grid_parallel|Hub-4 manual]].
  
-For firmware version requirements, refer to the [[system_integration:hub4_grid_parallel|main hub-4 manual]]. +Note that though this page mentions Hub-4, which is deprecatedit also applies to ESS.
- +
-Three/split-phase systems are not possible yetexpected date is 2016 Q2. No hardware changes will be necessarythere will only be firmware upgrades.+
  
 ===== 1. Overview of Hub-4 operating modes ===== ===== 1. Overview of Hub-4 operating modes =====
  
 ==== 1.1 Mode 1 - Standard ==== ==== 1.1 Mode 1 - Standard ====
-Standard \\ 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 Color Control GX. +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 Color Control GX. For details refer to the [[system_integration:hub4_grid_parallel|main hub-4 manual]].
- +
-Necessary Victron equipment: +
-  - Multi or Quattro inverter/charger +
-  - Color Control GX +
-  - AC sensor used for control loop +
- +
-For details refer to the [[system_integration:hub4_grid_parallel|main hub-4 manual]].+
  
 ==== 1.2 Mode 2 - Advanced ==== ==== 1.2 Mode 2 - Advanced ====
-Same as standard operating mode, but more flexibility is given to implement time shifting, load management or other energy management optimization algorithms. Either by ModbusTCP commands or by running additional self implemented code on the Color Control GX. Often the best of both worlds: complete flexibility and benefit from the VRM Portal and all other functionality already available on the CCGXwithout having to add additional cost of extra PLCs or other control modules. +Same as standard operating mode, but customer adds 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 defaultMode 1. The available control points are:
- +
-Necessary Victron equipment: +
-    - Same as mode 1, Standard +
- +
-Available control points:+
   * Grid power setpoint   * Grid power setpoint
   * Maximum charge percentage   * Maximum charge percentage
   * Maximum discharge percentage   * Maximum discharge percentage
 +
 +There are two ways access those control points:
 +  - Send commands to the CCGX via ModbusTCP, from an external control module, a PLC for example.
 +  - Run self-implemented scripts on the CCGX, same functionality, but then it is not needed to add a PLC to the system.
 +
 +For more information, see [[#details_of_operating_mode_2_-_advanced|the Mode 2 details]].
 +
 ==== 1.3 Mode 3 - Custom ==== ==== 1.3 Mode 3 - Custom ====
 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 charger itself. 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 charger itself.
Line 46: Line 39:
   * Disable charge flag   * Disable charge flag
   * Disable feedback flag   * Disable feedback flag
 +
 +For more information, see [[#details_of_operating_mode_3_-_custom|the Mode 3 details]].
 +
  
 ===== 2. Details of operating mode 2 - Advanced ===== ===== 2. Details of operating mode 2 - Advanced =====
  
-==== 2.1 Operation ==== +==== 2.1 Available control points ==== 
-  Grid power setpoint. A positive value: power is taken from grid. Negative value: power fed back to grid. Note that the maximum charge and discharge percentages documented below have priority over the grid power setpoint+ 
-    D-Buscom.victronenergy.hub4 /AcPowerSetpoint +=== a) Grid power setpoint - Modbus-TCP register 2700 === 
-    Modbus: Register 2700, unit ID 0 +  * Positivetake power from grid.  
-  * Maximum charge percentageLimits the power taken in by the Multi through AC-In.  +  * Negative: send power to grid. 
-    * 0%: disable charging. This setting may be used for time shifting. For example by disabling charging the battery when feeding back to the grid is profitable, and leaving battery capacity for later. +  Default0W
-    * 100%: no charge power not limited by CCGX (max charge current on multi still applies)+ 
-    * >0% and <100%: The maximum allowed AC-In power is\\ ''max charge percentage * max charge current * battery voltage / 100''\\ The maximum charge current is taken from the settings on the Multi (which can be changed using VE configure). \\ Because this setting limits the power taken in on the Ac-In of the multi, it may give unexpected results when the AC-Out of the multi is also in use (for example to connect critical loads). +=== b) Max charge current (fractional) - Modbus-TCP register 2701 === 
-    D-Bus: com.victronenergy.hub4 /MaxChargePercentage +Reduces the charge current relative to the maximum charge currentNote that this settings has a higher priority than the //Grid power setpoint//
-    Modbus: Register 2701, unit ID 0 + 
-  * Maximum discharge percentageCan be used to enabled or disable battery dischargeValue < 50 means that discharge is disabledOtherwise discharge current is limited only by the battery and/or the Multi+  * 0%: disable charging. This setting may be used for time shifting. For example by disabling charging the battery when feeding back to the grid is profitable, and leaving battery capacity for later. 
-    * D-Bus: com.victronenergy.hub4 /MaxDischargePercentage +  * 100%: unlimited charging. Battery, VEConfigure settings, and BMS permitting
-    * Modbus: Register 2702, unit ID 0+  * >0% and <100%: The maximum allowed AC-In power is\\ ''max charge percentage * max charge current * battery voltage / 100''\\ The maximum charge current is taken from the settings on the Multi (which can be changed using VE configure). \\ Because this setting limits the power taken in on the Ac-In of the multi, it may give unexpected results when the AC-Out of the Multi is also in use
 + 
 +=== c) Enable discharge - Modbus-TCP register 2702 === 
 +Though presented as a percentage, it is really a on/off mechanism. Setting the percentage below 50% will disable discharge. And setting it equal to or above 50% will enable discharge. 
 + 
 +See the Modbus-TCP excel sheet for scaling and datatypes, available [[https://www.victronenergy.com/support-and-downloads/whitepapers|here]]. 
 + 
 +==== 2.2 Accessing the control points ==== 
 + 
 +=== A) Via ModbusTCP === 
 +See above mentioned register numbers. Use ModbusTCP unitid 100. 
 + 
 +=== B) Via MQTT === 
 +Recently we have added MQTT to the protocols on the CCGX. For more information, see [[https://groups.google.com/forum/m/#!forum/victron-dev-venus|the developer mailing list]] as well as the [[https://github.com/victronenergy/dbus-mqtt|mqtt github repo]]. 
 + 
 +=== CRunning your own scriptson the CCGX === 
 +Start reading [[open_source:start|here]]
 + 
 +The Hub-4 related D-Bus paths are: 
 +  * com.victronenergy.hub4 /AcPowerSetpoint 
 +  com.victronenergy.hub4 /MaxChargePercentage 
 +  * com.victronenergy.hub4 /MaxDischargePercentage 
 + 
 +==== 2.3 Background ==== 
 +In standard mode the Hub-4 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 set 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 gridThis 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 dischargeThis allows you to control when the battery is charged and discharged
 + 
 +==== 2.4 Notes ====
  
-==== 2.1 Notes ==== 
   * The above settings are intended for power management, and will be overridden by battery safety mechanisms. For example: if the multi is in sustain mode - because the battery is almost empty - it will start charging the battery, event if the grid power setpoint is negative or the maximum charge percentage is set to zero.    * The above settings are intended for power management, and will be overridden by battery safety mechanisms. For example: if the multi is in sustain mode - because the battery is almost empty - it will start charging the battery, event if the grid power setpoint is negative or the maximum charge percentage is set to zero. 
   * Sustain will always remain in operation. Disabling charge will not disable sustain. Note that this was added to the Hub-4 Assistant released in january 2016 (version 154).   * Sustain will always remain in operation. Disabling charge will not disable sustain. Note that this was added to the Hub-4 Assistant released in january 2016 (version 154).
Line 71: Line 94:
 ===== 3. Details of operating mode 3 - Custom ===== ===== 3. Details of operating mode 3 - Custom =====
 ==== 3.1 Operation ==== ==== 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 easy control of the power flowing 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 set setpoint frequently.
 +
   * When the grid is available, the Multi will be connected to the grid. You can control its operation with the Power setpoint. When positive, energy will flow to the grid. When negative, energy will be taken from the grid. Some examples:   * When the grid is available, the Multi will be connected to the grid. You can control its operation with the Power setpoint. When positive, energy will flow to the grid. When negative, energy will be taken from the grid. Some examples:
-    * When set to +400W, it will feed 400W back through its input. This energy will be taken from the battery. If there is also a 200W AC load connected to AC output the total energy taken from the batteryt will be 600W. The batteries will always be discharged when the setpoint is positive.+    * When set to +400W, it will feed 400W back through its input. This energy will be taken from the battery. If there is also a 200W AC load connected to AC output the total energy taken from the battery will be 600W. The batteries will always be discharged when the setpoint is positive.
     * When set to -400W, it will take 400W from the AC input. When the load on the output is lower than 400W, it will charge the battery with the difference. When the load on the AC output is higher, it will discharge the battery with the difference. So with a negative setpoint charge/discharge depends also on the connected loads.     * When set to -400W, it will take 400W from the AC input. When the load on the output is lower than 400W, it will charge the battery with the difference. When the load on the AC output is higher, it will discharge the battery with the difference. So with a negative setpoint charge/discharge depends also on the connected loads.
     * **Important note**: When using the CCGX to communicate with the HUB-4 assistant (see further on) you should bear in mind that the CCGX inverts the setpoint. So positive becomes negative and vice versa.     * **Important note**: When using the CCGX to communicate with the HUB-4 assistant (see further on) you should bear in mind that the CCGX inverts the setpoint. So positive becomes negative and vice versa.
Line 90: Line 116:
   * Note that the mechanism is slow, which to our opinion is not perfect, but also no problem.   * Note that the mechanism is slow, which to our opinion is not perfect, but also no problem.
   * The 'VE.Bus to VE.Can interface' does not yet support reading and writing the hub4/grid-parallel setpoint.   * The 'VE.Bus to VE.Can interface' does not yet support reading and writing the hub4/grid-parallel setpoint.
-  * If your system contains a Hub-4 compatible AC-Sensor which is set up as grid meter, the CCGX will automatically enter mode 1 and start updating the AC power setpoint continuously. You can stop this by setting the value of /Settings/CGwacs/Devices/D<serial>/Hub4Mode in the settings D-Bus service (com.victronenergy.settings) to 3 (=hub4 control disabled). Replace <serial> with the serial number of the grid meter.+  * If your system contains a Hub-4 compatible AC-Sensor which is set up as grid meter, the CCGX will automatically enter mode 1 and start updating the AC power setpoint continuously. Starting from CCGX firmware version 1.70, you can disable this behavior in //Settings->Hub4->Hub4 Control//. This will also disable [[system_integration:hub4_grid_parallel|BatteryLife]]. In earlier versions you can stop hub-4 control by setting the value of /Settings/CGwacs/Devices/D<serial>/Hub4Mode in the settings D-Bus service (com.victronenergy.settings) to 3 (=hub4 control disabled). Replace <serial> with the serial number of the grid meter.
  
 ==== 3.3 Using the MK2 directly instead of CCGX ==== ==== 3.3 Using the MK2 directly instead of CCGX ====
Line 120: Line 146:
 So you have to scan the Assistant RAM records by looking at each ID_size record.  So you have to scan the Assistant RAM records by looking at each ID_size record. 
  
-Search for HUB4, and then RAM0 is the setpoint in Watts and RAM1 contains the flags: +Search for HUB4, and then AssistantRAM0 is the setpoint in Watts and AssistantRAM1 contains the flags: 
-  * bit0 of RAM1 contains the flag 'disable charge'  +  * bit0 of AssistantRAM1 contains the flag 'disable charge'  
-  * bit1 of RAM1 contains the flag 'disable feedback'+  * bit1 of AssistantRAM1 contains the flag 'disable feedback'
  
 Above information is an addendum to the 'Interfacing with VE.Bus products' document. Available from our [[https://www.victronenergy.com/support-and-downloads/whitepapers|whitepapers]]. Above information is an addendum to the 'Interfacing with VE.Bus products' document. Available from our [[https://www.victronenergy.com/support-and-downloads/whitepapers|whitepapers]].
Line 171: Line 197:
   * As an alternative to running the control loop externally, using ModbusTCP, it is also possible to run code on the CCGX itself and update the AcPowerSetpoint via D-Bus. We have one customer that is running a MQTT client on the CCGX, written in Python, that gets the control-loop output as updates from a MQTT broker. And the Python script sends them to the Multi, using D-Bus service com.victronenergy.vebus.ttyO1, and path /Hub4/AcPowerSetpoint   * As an alternative to running the control loop externally, using ModbusTCP, it is also possible to run code on the CCGX itself and update the AcPowerSetpoint via D-Bus. We have one customer that is running a MQTT client on the CCGX, written in Python, that gets the control-loop output as updates from a MQTT broker. And the Python script sends them to the Multi, using D-Bus service com.victronenergy.vebus.ttyO1, and path /Hub4/AcPowerSetpoint
      
 +
  
 ===== DISQUS ===== ===== DISQUS =====
 ~~DISQUS~~ ~~DISQUS~~
 +
system_integration/hub4_grid_parallel_external_control_loop.1458666696.txt.gz · Last modified: 2016-03-22 18:11 by pba

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki