ESP32 Based Chademo

Development and discussion of fast charging systems eg Chademo , CCS etc
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

ESP32 Based Chademo

Post by Bigpie »

I've been working on an ESP32 based Chademo implementation, it's pretty much a port of the SAM3X code that I was using on my DUE setup.

https://github.com/jamiejones85/ESP32-Chademo boards and software there. Will update the wiki with this option too. Can sell anyone the extra boards if you don't want to get JLCPCB to make you some up.
IMG_20230326_155533615_HDR.jpg
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: ESP32 Based Chademo

Post by arber333 »

Bigpie wrote: Sun Mar 26, 2023 3:19 pm I've been working on an ESP32 based Chademo implementation, it's pretty much a port of the SAM3X code that I was using on my DUE setup.

https://github.com/jamiejones85/ESP32-Chademo boards and software there. Will update the wiki with this option too. Can sell anyone the extra boards if you don't want to get JLCPCB to make you some up.
WoW thank you! I have already built the board here with idea it could work as chademo VCU too, i just wasnt able to rewrite the code yet.
If you dont mind i will just ripoff your SW work and repin your code for my VCU. I can test it pronto :).
viewtopic.php?t=2615

Hm... you use two CAN bus. Do you think the code would work with a single CAN?
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: ESP32 Based Chademo

Post by Bigpie »

Yea, just pull out the second can, I just use it for car integration
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: ESP32 Based Chademo

Post by arber333 »

Bigpie wrote: Sun Mar 26, 2023 3:50 pm Yea, just pull out the second can, I just use it for car integration
Thanks, I would just use a pullup pin that BMS would pulldown and stop Chademo if needed.
User avatar
uhi22
Posts: 601
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 91 times
Been thanked: 412 times

Re: ESP32 Based Chademo

Post by uhi22 »

A newbie question: What tool to use to view the schematic? Could you add a PDF of the schematic to GitHub?
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: ESP32 Based Chademo

Post by Bigpie »

VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
User avatar
uhi22
Posts: 601
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 91 times
Been thanked: 412 times

Re: ESP32 Based Chademo

Post by uhi22 »

This uses the internal CAN controller of the ESP for one CAN. Does this work stable? I made bad experiences with it, and others found out that the CAN ringbuffer hardware is buggy.
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: ESP32 Based Chademo

Post by Bigpie »

I'm using various ESP32's this way for multiple can interfaces, my battery MITM for example, not noticed any problems?
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Ben
Posts: 2
Joined: Mon Sep 19, 2022 10:09 am
Has thanked: 3 times

Re: ESP32 Based Chademo

Post by Ben »

Bigpie wrote: Sun Mar 26, 2023 3:19 pm I've been working on an ESP32 based Chademo implementation, it's pretty much a port of the SAM3X code that I was using on my DUE setup.

https://github.com/jamiejones85/ESP32-Chademo boards and software there. Will update the wiki with this option too. Can sell anyone the extra boards if you don't want to get JLCPCB to make you some up.
IMG_20230326_155533615_HDR.jpg
Hi, Bigpie.
Please place the archive of all libraries for this project that you are using.
I can't find the correct versions of libraries for this project to compile.
I want to redesign your project with an affordable, cheap and simple INA226 current sensor (INA219), with a galvanic isolation adum1201arz near the high-voltage battery, and a short wire of about 1 meter for i2c. I will check this scheme, do in easyeda and lay out here.
Perhaps I will also add FRAM and microSD to save CAN logs.
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: ESP32 Based Chademo

Post by Bigpie »

I've not got time at the moment, but here's the versions

Code: Select all

Using library ACAN_ESP32 at version 1.1.0
Using library ESPAsyncWebServer at version 1.2.3
Using library FS at version 2.0.0
Using library WiFi at version 2.0.0
Using library AsyncTCP at version 1.1.1
Using library ArduinoJson at version 6.20.1
Using library SPIFFS at version 2.0.0
Using library ACAN2515 at version 2.1.1
Using library SPI at version 2.0.0
Using library EEPROM at version 2.0.0
Using library AsyncElegantOTA at version 2.2.7
Using library Update at version 2.0.0
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Ben
Posts: 2
Joined: Mon Sep 19, 2022 10:09 am
Has thanked: 3 times

Re: ESP32 Based Chademo

Post by Ben »

thank you. i will try.
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: ESP32 Based Chademo

Post by Bigpie »

Attached a zip of them here for now.
Attachments
Archive 2.zip
(746.17 KiB) Downloaded 68 times
Archive.zip
(9.83 MiB) Downloaded 78 times
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: ESP32 Based Chademo

Post by arber333 »

Bigpie wrote: Sun Mar 26, 2023 3:50 pm Yea, just pull out the second can, I just use it for car integration
Hi again i think i will try to add your code to my ESP32 version. Can you tell me if you actively use Wifi interface to setup parameters for chademo? Or what do you use Data folder for?

tnx
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: ESP32 Based Chademo

Post by Bigpie »

Web interface for setting params and logging output
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: ESP32 Based Chademo

Post by arber333 »

Bigpie wrote: Tue May 23, 2023 7:10 pm Web interface for setting params and logging output
Ok thanks. It seems you only use the 16 and 17 pins for CAN1 which you use with MCP chip. I dont see any code to innitalize CAN0 here. Do you actually use 4 and 5 pins for CAN0? I see code calls out ACAN_ESP32 library?

Do you think ACAN2515 would work with CAN1 and CAN0 with Collins esp32_can library in the same ESP32? I am really more used to CAN_common library and commands as i use it with DUE...
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: ESP32 Based Chademo

Post by Bigpie »

The on board can peripheral is initialised with the code below, using ACAN library for ESP32 16 and 17 for onboard can.

Code: Select all

ACAN_ESP32_Settings canSettings(CAN_BAUD);
  canSettings.mRxPin = GPIO_NUM_16;
  canSettings.mTxPin = GPIO_NUM_17;
  uint16_t errorCode = ACAN_ESP32::can.begin(canSettings);
  if (errorCode > 0) {
    Serial.print ("Can0 Configuration error 0x") ;
    Serial.println (errorCode, HEX) ;
  }
The SPI can with the code below, uses the ACAN2515 library.

Code: Select all


SPI.begin(MCP2515_SCK, MCP2515_MISO, MCP2515_MOSI, MCP2515_CS) ;
  ACAN2515Settings settings2515 (MCP2515_QUARTZ_FREQUENCY, CAN_BAUD);
  errorCode = can1.begin(settings2515, [] { can1.isr () ; });
  if (errorCode > 0) {
    Serial.print ("Can1 Configuration error 0x") ;
    Serial.println (errorCode, HEX) ;
  }
You could use Colin's library if you prefer it
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: ESP32 Based Chademo

Post by arber333 »

Bigpie wrote: Tue May 23, 2023 7:10 pm Web interface for setting params and logging output
Can you post a screenshot of your wifi charging interface? Just a teaser... :)
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: ESP32 Based Chademo

Post by Bigpie »

ESP32-BMS.jpeg
Screenshot 2023-05-24 at 9.18.38 am.png
Will this do? Wasn't charging, just sat on the drive.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: ESP32 Based Chademo

Post by arber333 »

Bigpie wrote: Wed May 24, 2023 8:21 am ESP32-BMS.jpegScreenshot 2023-05-24 at 9.18.38 am.png Will this do? Wasn't charging, just sat on the drive.
Really good thank you. Its just what i was hoping for :). I will adapt the code and test it in my Chademo setup.
whereswally606
Posts: 43
Joined: Sun Nov 14, 2021 6:16 pm
Has thanked: 1 time
Been thanked: 2 times

Re: ESP32 Based Chademo

Post by whereswally606 »

amazing work Jamie, was hoping for something like this for CCS for when i supplement the env200's rapid charging capabilities. would be great to have the kind of logging that something like this is capable of. My pet hate is a failed charge when you're not sure whether its the charger or the car at fault. recently bought a resjacan board to try to implement the export matching of ovms but on an esp32 so will be dusting off my software skills again soon.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: ESP32 Based Chademo

Post by arber333 »

Bigpie wrote: Tue May 23, 2023 9:13 pm The on board can peripheral is initialised with the code below, using ACAN library for ESP32 16 and 17 for onboard can.
...
You could use Colin's library if you prefer it
Can you let me know what is with the 1K pullup resistor on the IN2 pin? Do we need one or can we live without one?
It is important to know because i dont have opto inputs designed into my board. I use simple 10k/2k7 resistor dividers on analog pins or 10k pullups on digital input pins. As i wanted to use those inputs with relay towards GND their voltage vulnerability didnt matter much...

tnx
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: ESP32 Based Chademo

Post by Bigpie »

whereswally606 wrote: Fri May 26, 2023 10:31 pm amazing work Jamie, was hoping for something like this for CCS for when i supplement the env200's rapid charging capabilities.
I've started looking at CCS based on the Catphish/Uhi stuff.
arber333 wrote: Can you let me know what is with the 1K pullup resistor on the IN2 pin?
The EVSE will ground IN2 when ready to charge, you could do away with it, johu/zombie based chademo doesn't use IN2, but the code will need changing a little
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: ESP32 Based Chademo

Post by arber333 »

Bigpie wrote: Sun Jun 04, 2023 3:37 pm The EVSE will ground IN2 when ready to charge, you could do away with it, johu/zombie based chademo doesn't use IN2, but the code will need changing a little
How? Is it simple changing IN2 from input to input_pullup? If that is all i am good. But if not i will simply attach IN2 to one of the analog inputs...
I still have time as i wait for chademo socket to arrive :).

CCS is for the future when i am not rebuilding our house at the same time :).
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: ESP32 Based Chademo

Post by Bigpie »

In theory youd be safe without the opto and just a pullup on the digital input, I ran like that on the due for a while.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: ESP32 Based Chademo

Post by Ev8 »

Trinium Mer charger today, started charge fine charged to 71% (bms Soc) and then kicked me off whilst still charging at 50a, possibly an issue with my settings I have changed them since going 96s but maybe target of 384 and maximum of 393 is too low? 384 is 4v per cell and was kicked off with cells above 3.9… the charger showed an impossible Soc of 156% to start and then actually fell to 142% when does the charger get it’s Soc from?
Attachments
BC983120-02F9-4547-9188-DBB76EBD2CD6.jpeg
87910BF3-E4F0-4A6D-BD31-0BEED5E341FD.jpeg
Post Reply