I think all the building blocks are there to create a (partially) open bidirectional DC EV charger.
Ingredients
- Commercial battery or hybrid inverter allowing 400V battery voltage (e.g. SMA, Growatt etc)
- Alternative 1: pure PV inverter with settable power limit and some hacked OBC for charging
- Alternative 2: use the cars OBC for charging, would require a true "Combo" CCS plug with AC pins
- BeagleBone or Raspberry running pyPLC in EVSE mode
- Powerline modem
- CCS cable
Whatever supplies DC power also needs to be able to precharge its output to the cars battery voltage. I think many OEM cars won't close their port relays otherwise.
Question: Can the powerline modem be used as-is only with patched PIB? Like capacitive coupling from L to CP?
Here is the datasheet of the Growatt
https://growatt.tech/wp-content/uploads ... 202201.pdf
I think the cars port relays would be permanently closed. Excess PV energy is dumped into the car until it can take no more (denoted by current limit or some upper SoC limit, both communicated by CCS). And when energy is needed it can be drawn from the car until a lower SoC or voltage limit is reached. It's probably most versatile to run this in parallel to the grid but of course an offgrid scenario works as well if you have a small secondary battery to supply your home while the car is gone.
I have the 11 kW MG charger here and ad my dads place a 6 kW SMA PV inverter. So not even a need to spend money on anything
Bidirectional charger with PV Hybrid inverter and pyPLC
- johu
- Site Admin
- Posts: 6086
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 214 times
- Been thanked: 1212 times
- Contact:
Bidirectional charger with PV Hybrid inverter and pyPLC
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- uhi22
- Posts: 845
- Joined: Mon Mar 14, 2022 3:20 pm
- Location: Ingolstadt/Germany
- Has thanked: 118 times
- Been thanked: 502 times
Re: Bidirectional charger with PV Hybrid inverter and pyPLC
The prove-of-concept of a separate software-controllable precharge-supply is available here: https://github.com/uhi22/stepup-test#le ... ut-voltage
Github: http://github.com/uhi22 --- Patreon: https://www.patreon.com/uhi22
- johu
- Site Admin
- Posts: 6086
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 214 times
- Been thanked: 1212 times
- Contact:
Re: Bidirectional charger with PV Hybrid inverter and pyPLC
You've got everything Could also replace the bespoke voltage sense board with the input voltage report of the PV inverter
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Re: Bidirectional charger with PV Hybrid inverter and pyPLC
Another useful ingredient could be this: https://github.com/dalathegreat/Battery-Emulator
- uhi22
- Posts: 845
- Joined: Mon Mar 14, 2022 3:20 pm
- Location: Ingolstadt/Germany
- Has thanked: 118 times
- Been thanked: 502 times
Re: Bidirectional charger with PV Hybrid inverter and pyPLC
Yes, this should be fine. Even just running CP and L in the same cable for a meter should most likely be sufficient coupling.
Github: http://github.com/uhi22 --- Patreon: https://www.patreon.com/uhi22
- johu
- Site Admin
- Posts: 6086
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 214 times
- Been thanked: 1212 times
- Contact:
Re: Bidirectional charger with PV Hybrid inverter and pyPLC
As a winter project I'm considering making a BeageBone cape that has the powerline modem and stateC switching on it, maybe also some serial or CAN port.
Could use some input on how to make the apparently existing qca-spi Linux driver work.
https://github.com/qca/qca7000
https://github.com/torvalds/linux/blob/ ... /qca_spi.c
It's been a while since I did kernel hacking
Could use some input on how to make the apparently existing qca-spi Linux driver work.
https://github.com/qca/qca7000
https://github.com/torvalds/linux/blob/ ... /qca_spi.c
It's been a while since I did kernel hacking
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- uhi22
- Posts: 845
- Joined: Mon Mar 14, 2022 3:20 pm
- Location: Ingolstadt/Germany
- Has thanked: 118 times
- Been thanked: 502 times
Re: Bidirectional charger with PV Hybrid inverter and pyPLC
I understood that the spi ethernet driver is already included in current distributions. No idea where I got this info from
Edit: https://forums.raspberrypi.com/viewtopic.php?t=337718
Edit: https://forums.raspberrypi.com/viewtopic.php?t=337718
Github: http://github.com/uhi22 --- Patreon: https://www.patreon.com/uhi22
- johu
- Site Admin
- Posts: 6086
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 214 times
- Been thanked: 1212 times
- Contact:
Re: Bidirectional charger with PV Hybrid inverter and pyPLC
I found the qcaspi module isn't compiled by default so I have to do something like this https://docs.beagleboard.org/latest/boo ... ernel.html
So far I failed to find the appropriate source code.
UPDATE: got the module to load without even the QCA connected
Had to use a kernel version matching the running kernel
https://github.com/RobertCNelson/ti-lin ... nux-4.19.y
and modify the Makefile
Now just have to find out which SPI device this is expected to connect to and which is the correct /CS and INT pin
So far I failed to find the appropriate source code.
UPDATE: got the module to load without even the QCA connected
Had to use a kernel version matching the running kernel
https://github.com/RobertCNelson/ti-lin ... nux-4.19.y
and modify the Makefile
Code: Select all
# SPDX-License-Identifier: GPL-2.0
#
# Makefile for the Qualcomm network device drivers.
#
obj-m += qca_7k_common.o
obj-m += qcaspi.o
qcaspi-objs := qca_7k.o qca_debug.o qca_spi.o
obj-m += qcauart.o
qcauart-objs := qca_uart.o
obj-y += emac/
obj-m += rmnet/
KDIR := /lib/modules/$(shell uname -r)/build
all:
make -C $(KDIR) M=$$PWD
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 6086
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 214 times
- Been thanked: 1212 times
- Contact:
Re: Bidirectional charger with PV Hybrid inverter and pyPLC
Hmm, it no longer boots with the QCA overlay configured.
It doesn't seem like it's related to the QCA overlay but with it removed it boots up fine
I think the actual problem here is "Did not find a cmdline Flattened Device Tree" while on a good boot this says "Flattened Device Tree blob at 88000000"
And my dtc
It doesn't seem like it's related to the QCA overlay but with it removed it boots up fine
Code: Select all
U-Boot SPL 2019.04-00002-g07d5700e21 (Mar 06 2020 - 11:24:55 -0600)
Trying to boot from MMC2
Loading Environment from EXT4... Card did not respond to voltage select!
U-Boot 2019.04-00002-g07d5700e21 (Mar 06 2020 - 11:24:55 -0600), Build: jenkins-github_Bootloader-Builder-137
CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Global external warm reset has occurred.
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... Card did not respond to voltage select!
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
Model: SeeedStudio BeagleBone Green:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net: eth0: MII MODE
cpsw, usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[BBG1] ...
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
Card did not respond to voltage select!
Card did not respond to voltage select!
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc1(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
2068 bytes read in 15 ms (133.8 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.19.94-ti-r42 ...
10095592 bytes read in 655 ms (14.7 MiB/s)
debug: [enable_uboot_overlays=1] ...
debug: [enable_uboot_cape_universal=1] ...
debug: [uboot_base_dtb_univ=am335x-boneblack-uboot-univ.dtb] ...
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot-univ.dtb] ...
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot-univ.dtb ...
loading /boot/dtbs/4.19.94-ti-r42/am335x-boneblack-uboot-univ.dtb ...
162266 bytes read in 44 ms (3.5 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /lib/firmware/M-BB-BBG-00A0.dtbo ...
423 bytes read in 183 ms (2 KiB/s)
uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ...
867 bytes read in 381 ms (2 KiB/s)
uboot_overlays: loading /lib/firmware/BB-SPI0-QCA7K-0A00.dtbo ...
1695 bytes read in 132 ms (11.7 KiB/s)
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ...
1584 bytes read in 366 ms (3.9 KiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /__symbols__ node
make sure you've compiled with -@
uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo ...
3801 bytes read in 39 ms (94.7 KiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /__symbols__ node
make sure you've compiled with -@
loading /boot/initrd.img-4.19.94-ti-r42 ...
6589689 bytes read in 433 ms (14.5 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet] ...
debug: [bootz 0x82000000 0x88080000:648cf9 88000000] ...
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
** Invalid partition 2 **
** Invalid partition 3 **
** Invalid partition 4 **
** Invalid partition 5 **
** Invalid partition 6 **
** Invalid partition 7 **
starting USB...
USB0: Port not available.
cpsw Waiting for PHY auto negotiation to complete......... TIMEOUT !
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
musb-hdrc: peripheral reset irq lost!
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17
BOOTP broadcast 18
BOOTP broadcast 19
BOOTP broadcast 20
BOOTP broadcast 21
BOOTP broadcast 22
BOOTP broadcast 23
BOOTP broadcast 24
BOOTP broadcast 25
BOOTP broadcast 26
BOOTP broadcast 27
BOOTP broadcast 28
BOOTP broadcast 29
Retry time exceeded; starting again
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/01-e4-15-f6-f6-5c-90
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/00000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/0000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/000000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/00000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/0000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/00
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/0
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/default-arm-am33xx
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/default-arm
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Retrieving file: pxelinux.cfg/default
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
*** ERROR: `ipaddr' not set
Config file not found
starting USB...
USB0: Port not available.
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC e4:15:f6:f6:5c:8e
HOST MAC de:ad:be:af:00:00
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17
BOOTP broadcast 18
BOOTP broadcast 19
BOOTP broadcast 20
BOOTP broadcast 21
BOOTP broadcast 22
BOOTP broadcast 23
BOOTP broadcast 24
BOOTP broadcast 25
BOOTP broadcast 26
BOOTP broadcast 27
BOOTP broadcast 28
BOOTP broadcast 29
Retry time exceeded; starting again
And my dtc
Code: Select all
/*
* Copyright (C) 2019 Tomas Arturo Herrera Castro <taherrera@uc.cl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Written as part of my master's thesis at PUC Chile,
* to run the BeagleBone as an OpenThread Border Router w/o an NCP.
*
* http://www.sltech.cl
*
* Compiled using: make ./src/arm/BB-SPI0-AT86RF233-00A0.dtbo
*
* Tested on BeagleBone Black Rev. C + REB233-XPRO. Linux beaglebone 4.14.71-ti-r80.
*
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/board/am335x-bbw-bbb-base.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/interrupt-controller/irq.h>
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green";
/* identification */
part-number = "BB-QCA7000";
version = "00A0";
/* state the resources this cape uses */
exclusive-use =
/* the pin header uses */
"P9.15", /* P9_15 (U18) INT */
"P9.17", /* P9_17 (A16) spi0_cs0.spi0_cs0 */
"P9.18", /* P9_18 (B16) spi0_d1.spi0_d1 */
"P9.21", /* P9_21 (B17) spi0_d0.spi0_d0 */
"P9.22", /* P9_22 (A17) spi0_sclk.spi0_sclk */
/* the hardware ip uses */
"spi0";
/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
fragment@0 {
target-path="/";
__overlay__ {
chosen {
overlays {
BB-SPI0-QCA7000-00A0 = __TIMESTAMP__;
};
};
};
};
/*
* Free up the pins used by the cape from the pinmux helpers.
*/
fragment@1 {
target = <&ocp>;
__overlay__ {
P9_17_pinmux { status = "disabled"; }; /* P9_17 (A16) spi0_cs0.spi0_cs0 */
P9_18_pinmux { status = "disabled"; }; /* P9_18 (B16) spi0_d1.spi0_d1 */
P9_21_pinmux { status = "disabled"; }; /* P9_21 (B17) spi0_d0.spi0_d0 */
P9_22_pinmux { status = "disabled"; }; /* P9_22 (A17) spi0_sclk.spi0_sclk */
P9_15_pinmux { status = "disabled"; }; /* irq P9_15 (R13) gpmc_a0.gpio1[16] */
};
};
fragment@2 {
target = <&am33xx_pinmux>;
__overlay__ {
bb_qca_pins: bb_qca_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_GPMC_A0, PIN_INPUT_PULLDOWN, MUX_MODE7)
>;
};
spi0_qca_s0: spi0_qca_s0 {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_INPUT, MUX_MODE0) /* P9_22 (A17) spi0_sclk.spi0_sclk */
AM33XX_PADCONF(AM335X_PIN_SPI0_D0, PIN_INPUT, MUX_MODE0) /* P9_21 (B17) spi0_d0.spi0_d0 */
AM33XX_PADCONF(AM335X_PIN_SPI0_D1, PIN_INPUT, MUX_MODE0) /* P9_18 (B16) spi0_d1.spi0_d1 */
AM33XX_PADCONF(AM335X_PIN_SPI0_CS0, PIN_INPUT, MUX_MODE0) /* P9_17 (A16) spi0_cs0.spi0_cs0 */
>;
};
};
};
fragment@3 {
target = <&spi0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi0_qca_s0>;
qca7000: ethernet@0 {
compatible = "qca,qca7000";
reg = <0x0>;
interrupt-parent = <&gpio1>; /* GPIO Bank 1 */
interrupts = <16 0x1>; /* Index: 16, rising edge */
spi-cpha; /* SPI mode: CPHA=1 */
spi-cpol; /* SPI mode: CPOL=1 */
spi-max-frequency = <8000000>; /* freq: 8 MHz */
local-mac-address = [ A0 B0 C0 D0 E0 A1 ];
};
};
};
};
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9