lluisball / godenerg

Atersa / Axpert Inverter python library / interface / tool
GNU General Public License v3.0
35 stars 14 forks source link

GODENERG

Atersa / Axpert / Master Power / Voltronics Inverter python library / interface / tool

The idea is to develop a tool that works better that the dubious WatchPower program that comes with the inverter and improves in practicality by been usable through the network.

The Watchpower is a badly coded piece of Java that works as a GUI tool and has no network functionality when used with USB or Serial connections.

Godenerg should be usable in a Raspberry Pi and could be left connected to a house LAN acting as a bridge to the inverter. For instance, right now I am using Godenerg provide the real-time data I need to display through HTTP into a Raspberry Pi in my living room that uses a OLED to display real-time stats.

Current features:

TODO:

Charging:

Besides offering realtime data like WatchPower, this software is intented to by-pass the big elephant in the room with this inverter, the charger:

  1. The firmware in the inverter has a massive bug that the developers are not addressing. When the inverter is charging, if the available amperage to charge, drops below 1/5 of the max charging amperage set in the settings, it stops cold the charge process (in less than a minute). If you happen to get a couple of clouds and have a rice cooker on, for instance, you can forget about getting a full charge. The inverter will stay in float voltage and the day's charge will be over.

  2. Because of the mentioned bug you have to lower the max charging amperage if you want to minimize the issue and if you happen to have quite a bit of PV power like I have (3.8KW), you are not using the available energy.

  3. Cloudy days, instead of charging with whatever energy there is (no worries for overcharging there), the inverter sits there at float voltage.

  4. They are some patched firmwares that try to address this problems, but the are patched firmwares by individuals and no source code is released. I could give them a try but I fear bricking the inverter since my only means of energy is the PV array.

  5. Latest releases of the official firmware just wait 10 minutes before dropping to float voltage instead of under a minute. I guess they tried boging a fix but is still not correct.

To implement a charger from Godenerg:

Therefore:

  1. I can wait for the desired absorption voltage to be reached (bulk phase), forcing float voltage to be equals to absorption voltage.

  2. Then I can monitor the average voltage and charge current through time as the absorption phase is happening.

  3. When the amperage is low enough I can change the float voltage to the real float voltage.

With this mechanics I mimic the desired charging curve of volts vs amps described in all the charging documentation I find for sealed lead acid batteries.

charge curve example (graph generated with godenerg: http://host:8890/graph?from=2017111807&to=2017111819&col_2=batt_charge_amps&col_1=batt_volt)

Current project status:

Current inverter setup:

Testing:

I will put more energies into testing during the next weeks. Since I needed this software in an urgent manner, I have not been the best testing for everything.

 $> pytest -v --pyargs axpert

Run as daemon

 $> python3 axpert/main.py --usb -d /dev/hidraw0 --daemon

Run as command line tool

Get current status values (QPIGS command)

 > python3 axpert/main.py --usb -d /dev/hidraw0 --status

 (000.0 00.0 230.0 50.0 0322 0221 006 425 52.80 011 100 0040 0016 100.6 52.78 00000 01110110 00 00 00844 010

Get current status values as JSON

 > python3 axpert/main.py --usb -d /dev/hidraw0 --status --json

    {"ssc_firmware_updated": false, "grid_volt": 0.0, "raw_status": "01010000", "batt_volt": 49.7, "ac_volt": 229.9, "batt_capacity": 75, "configuration_changed": true, "pv_amps": 0, "bus_volt": 400.0, "ac_freq": 50.0, "ac_va": 298, "mask_d": 10, "batt_charge_amps": 0, "batt_volt_scc": 0.0, "load_status": true, "sbu_priority_version": false, "pv_volts": 0.0, "temp": 45, "load_percent": 6.0, "charge_source": ["not_charging"], "batt_discharge_amps": 5, "pv_watts": 0, "batt_volt_to_steady": false, "mask_c": 0, "grid_freq": 0.0, "mask_b": 0, "ac_watt": 241}

Get operation mode (QMOD command):

 > python3 axpert/main.py --usb -d /dev/hidraw0 --op-mode

Get operation mode as json:

 > python3 axpert/main.py --usb -d /dev/hidraw0 --op-mode --json

    {"mode": "BT"}

Change Float Voltage to 53.0 V

 > python3 axpert/main.py --usb -d /dev/hidraw0 --cmd PBFT -v 53.0  -s 8
 (ACK

Change Utility MAX charge current to 10 amps for first paralel device

 > python3 axpert/main.py --usb -d /dev/hidraw0 --cmd MCHGC -v 010 -s 8 
 (ACK

Extract data from datalogger

 > python3 axpert/main.py --usb -d /dev/hidraw0 --extract-csv-data 20171031000000-20171031235959 --col datetime --col batt_volt --col batt_charge_amps --extract-file stats.csv