Chademo Controller Development

Development and discussion of fast charging systems eg Chademo , CCS etc
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: Chademo Controller Development

Post by mdrobnak »

That looks awfully like the port I have from a Leaf...

Glad to see my 'hey can't we simplify this' theory wasn't crazy in the end. ;)

Thanks Isaac for taking this on.

-Matt
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

Jack Bauer wrote: Thu Jul 23, 2020 8:28 am Ok, so I wasn't using the "=" sign which was the problem with the serial monitor ignoring the commands. What happens now is if I type say "V=395" and hit enter the serial monitor freezes and the SAM3 locks up. However, if I then reboot and hit "p" it has actually updated and saved the parameter so it must be hanging on return from the eeprom routine. I also ran the eeprom test and it works fine so I don't think its hardware.

Isaac96, really appreciate your help. This project has been crying out to be ported to a more capable micro since 2015.

In other news my Chademo port turned up so will have a car ready to do some actual testing soon.
Well at least it's saving now...

There's a "noInterrupts()" call at the beginning of the save() function. Then "interrupts()" gets called again at the end.
Are you getting a "SAVED" message after setting a parameter? (probably not since the monitor is locking up).

Also I'm a blithering idiot - my GEVCU hardware actually has a M24M02 EEPROM on it already. I'll start testing with that in about 5 minutes. Should be able to solve these issues quite easily.

-Isaac

EDIT Uploaded the code, I'm getting the same issue. Will add more debugging messages and see what's going on.
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

Here's version 0.3, with more improvements and still less clutter.

-Added help menu - shows when a wrong command is entered and on startup
-Fixed EEPROM - turned out to be something weird about the delays and the interrupt() function.
-Improved AH/KWH counters (just uses ISA numbers now, resets them to zero at certain times)
-Took out some extra functions that did nothing


I'm trying to strip this down to the bare minimum while retaining the configuration capabilities. Not messing with the Chademo (though that might be necessary) but allowing lots of room for expansion in whatever direction anyone wants.

Let me know how this works!

-Isaac
Attachments
LeafVCUChademo03.zip
(12.64 KiB) Downloaded 86 times
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

Disregard previous attachment please - it's got the wrong logic on the inputs and the outputs are swapped. The old JLD505 has optocoupled inputs, Leaf VCU has none.

Here's the corrected version (v0.3b?).

-Isaac
Attachments
LeafVCUChademo03.zip
(12.71 KiB) Downloaded 85 times
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Chademo Controller Development

Post by Jack Bauer »

Working perfectly (at least on the bench). Added this line to Setup() to give a heartbeat led : pinMode(13, OUTPUT); //led

Will be a few weeks before I have the E39 kitted out with a Chademo "exhaust" for testing. If anyone else is going to get there quicker and willing to help with testing,I'll donate a leaf vcu. In the meantime I'll get my wifi guy to do some wifi firmware so we can have a display ready to go.

Isaac96, if you are happy I'll throw this up on Github?
I'm going to need a hacksaw
User avatar
Kevin Sharpe
Posts: 1345
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 4 times

Re: Chademo Controller Development

Post by Kevin Sharpe »

Jack Bauer wrote: Fri Jul 24, 2020 7:54 am Will be a few weeks before I have the E39 kitted out with a Chademo "exhaust" for testing. If anyone else is going to get there quicker and willing to help with testing,I'll donate a leaf vcu.
I can probably help in a few weeks if no one else is ready.

I'm making a CHAdeMO to CCS adaptor which in it's first iteration could simply bypass the CCS functionality. We could also jury rig a CHAdeMO interface into the bus directly for testing 8-)
This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

Jack Bauer wrote: Fri Jul 24, 2020 7:54 am Working perfectly (at least on the bench). Added this line to Setup() to give a heartbeat led : pinMode(13, OUTPUT); //led

Will be a few weeks before I have the E39 kitted out with a Chademo "exhaust" for testing. If anyone else is going to get there quicker and willing to help with testing,I'll donate a leaf vcu. In the meantime I'll get my wifi guy to do some wifi firmware so we can have a display ready to go.

Isaac96, if you are happy I'll throw this up on Github?
Yup, go ahead. I've checked through the code a couple times now, all seems correct.

I can probably start testing Chademo in a couple of days (with my different hardware) but first I have to get a shunt hooked up and add a few CAN messages (only in my version) to get voltage readings.

The Chademo stations will probably not be happy if my voltage readings are too far off... My custom BMS has quite a slow sample rate (it's talking to 12 different things at 9600, one at a time) so I might have to add some hacks to make that work.

-Isaac
User avatar
arturk
Posts: 146
Joined: Wed Oct 02, 2019 3:58 am
Location: United States, MD
Has thanked: 1 time
Been thanked: 2 times

Re: Chademo Controller Development

Post by arturk »

Jack Bauer wrote: Fri Jul 24, 2020 7:54 am Working perfectly (at least on the bench). Added this line to Setup() to give a heartbeat led : pinMode(13, OUTPUT); //led

Will be a few weeks before I have the E39 kitted out with a Chademo "exhaust" for testing. If anyone else is going to get there quicker and willing to help with testing,I'll donate a leaf vcu.
I have car ready to test it and all other components except Leaf VCU...
1998 Jaguar XJR, GS450h drivetrain, 48kWh/96s BMW battery
User avatar
mcgousha
Posts: 28
Joined: Mon Mar 11, 2019 4:20 pm
Location: Surrey, UK
Contact:

Re: Chademo Controller Development

Post by mcgousha »

I must have been working in IT projects for too long, I really enjoyed reading through the last couple of days on this thread. 😄

Fantastic collaboration happening here. Big kudos to Isaac96 for stepping up to the plate and sharing his skills.

I'll throw my hat into the ring as a potential tester (assuming it's still needed) as soon as I have the battery installed in the Porsche, I have a Leaf Chademo port just waiting to be put back to use.
This seemed like a great idea at the time
https://www.youtube.com/channel/UCca95a ... 33wJBAMe5g
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

I'm doing some bench testing... Some very weird things happening.
I am testing with my GEVCU hardware, so pins 48-51 are usable as inputs.
For some reason 48 and 50 don't work with the rest of the Chademo code. When read by a simple DigitalReadSerial they read the inputs just fine but when the Chademo code is set to use them, no readings (they stay high).

I'm fairly sure this is caused by some of the libraries in use but don't have the time right now to test all that properly.

The problem here is that the Leaf VCU uses pins 49 and 48 as outputs, so I don't know if those will work, and can't fully test the output side.
(48 and 50 don't appear to work as outputs, 49 and 51 probably do work).

Yes, I'm very confused. Going to set off to the local Chademo station and see if the init sequence is acceptable at the altar of EVGo.

-Isaac
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

I think the inputs are reading correctly. However, the charger is timing out.
IN1 gets pulled high by the station, the car begins sending CAN, then the station shuts down with a 'communication error'.
I'm going to test CAN more properly -- it certainly receives properly, but I may or may not have reversed the wiring, and haven't tested sending yet.
Getting close to full communication though.

-Isaac
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Chademo Controller Development

Post by Jack Bauer »

Excellent work and thanks everyone for offers of assistance.
I'm going to need a hacksaw
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

Thanks for the kind words guys, it's not quite there yet though. :)

Found the issue with pins 48/50 - the due_can library defaults to using them for CAN enable.
So I'm setting the CAN enable pins to 255 (which nulls them out).
ISA.h also needed changes since it also defaults to 48/50. Modified version is attached.
(That library is weird, it seems to autosave/autorecover amp-hours on power reset. No idea if that works, I don't have an ISA shunt yet).

I also seem to have forgotten that the CAN mailboxes needed to be set up -- I just added that in along with a little more debugging (since there are plenty of bugs).
v0.4 is attached.

I'm going off for another test at the station. I do hope it works this time, it's such a pain to move the whole setup.

Note - when there's a 1.0 release I'd like to include copies of all the libraries, since at least one will end up modded and that's no fun for anyone else.

-Isaac
Attachments
LeafVCUChademo04.zip
(12.74 KiB) Downloaded 106 times
ISA.zip
(8.56 MiB) Downloaded 119 times
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

Went out for a test run, one station was in use by a Bolt and the other has a dead credit card reader...
I'll try again in an hour or so.

-Isaac
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: Chademo Controller Development

Post by mdrobnak »

Isaac96 wrote: Sat Jul 25, 2020 10:11 pm (That library is weird, it seems to autosave/autorecover amp-hours on power reset. No idea if that works, I don't have an ISA shunt yet).

I also seem to have forgotten that the CAN mailboxes needed to be set up -- I just added that in along with a little more debugging (since there are plenty of bugs).
Glad to see you've got that mostly going.
The auto save/recover is to try and compute accurate State of Health or Charge. Not sure which.
I didn't realize CAN mailboxes were "a thing" in most micro-controllers.. I have definitely have seen them on ST C167 16-bit processors. (Bosch ME 7.5/7.8 ECUs)
Isaac96 wrote: Sat Jul 25, 2020 10:45 pm Went out for a test run, one station was in use by a Bolt and the other has a dead credit card reader...
I'll try again in an hour or so.

-Isaac
How, like, 90s man. Don't you know apps are the future? ;)

-Matt
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

mdrobnak wrote: Sun Jul 26, 2020 12:08 am Glad to see you've got that mostly going.
The auto save/recover is to try and compute accurate State of Health or Charge. Not sure which.
I didn't realize CAN mailboxes were "a thing" in most micro-controllers.. I have definitely have seen them on ST C167 16-bit processors. (Bosch ME 7.5/7.8 ECUs)
Most microcontrollers with inbuilt CAN seem to have them -- SAM3X, Teensy (Freescale/NXP ARM chips). I don't know how to use them, just zeroed them all out :P
How, like, 90s man. Don't you know apps are the future? ;)

-Matt
Well, yes, but it's not exactly easy to run an app on a $30 flip phone ;)
CHAdeMO is not the future either -- Nissan has abandoned it on the new Ariya.

-Isaac
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

I finally beat the CAN issues (I think) and the station tried to start charging! (No battery connected meant it threw a voltage mismatch fairly quickly, but at least it got that far). Contactors fired correctly too. I need to get an ISA shunt (more likely to just use one of my spare LEM HTFS sensors).

In other news, anyone got a spare Leaf contactor? I may or may not have previously fried a couple while previously working on my car, and I need one more for Chademo. Willing to pay of course - a pair runs $90 on eBay.

-Isaac
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Chademo Controller Development

Post by Jack Bauer »

Isaac, shoot me a pm. I have a few contactors here and I'll throw in a leaf vcu. Sadly I don't have a spare ISA shunt as they are all in my cars. Will have to try and arrange a few more.
I'm going to need a hacksaw
User avatar
Cookie6000
Posts: 246
Joined: Wed May 08, 2019 9:27 am
Location: Wicklow, IRL
Has thanked: 12 times
Been thanked: 32 times
Contact:

Re: Chademo Controller Development

Post by Cookie6000 »

mcgousha wrote: Fri Jul 24, 2020 9:14 pm I'll throw my hat into the ring as a potential tester (assuming it's still needed) as soon as I have the battery installed in the Porsche, I have a Leaf Chademo port just waiting to be put back to use.
Same here. I'm very close to having the battery full in plus have a Chademo port ready to go. Will just need to order another Leaf board so more than willing to test.
Home of the #Audi8e - https://twitter.com/FiachraCooke
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Chademo Controller Development

Post by Jack Bauer »

Here is a first draft of a dedicated Chademo controller based on the Leaf VCU. Would appreciate it if people took a look over to see if (where) I have screwed up.

-Deleted unused pins and components.

-Added two onboard relays. RLY1 activates 12v feed to the vcu when chademo plug is inserted. RLY2 controls the HV contactors.

-Added pullup to IN1.

-Vehicle connections via the 12way connector. Chademo signals via the 20 way.

Want to keep it as simple and universal as possible so please don't ask me to add support for steering cruise missiles etc.
Attachments
chademo.png
Chademo_VCU_V1_ISA - Schematic.pdf
(231.35 KiB) Downloaded 143 times
I'm going to need a hacksaw
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

Looks good to me. It also makes me wonder whether my pin assignments are correct in the v0.4 code - they're in globals.h.
IN1 and IN0 may be reversed, would you mind checking that out? For that matter OUT0 and OUT1 might be backwards too. I think I set those according to the first VCU wiring diagram you put up.

Also, how should OUT3 be integrated into the software? I'm not sure what you're planning to use it for.

-Isaac
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Chademo Controller Development

Post by Jack Bauer »

So I want OUT3 to activate when hv is required and de activate when charging finishes. Yeah I've changed a few things around on this design but no need to worry about that right now. We'll just get it running on the leaf vcu then can adapt.
I'm going to need a hacksaw
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

Jack Bauer wrote: Tue Jul 28, 2020 6:35 am So I want OUT3 to activate when hv is required and de activate when charging finishes. Yeah I've changed a few things around on this design but no need to worry about that right now. We'll just get it running on the leaf vcu then can adapt.
Alright, I'll look at the code and see where that could fit. Is it intended to power up a contactor system?

-Isaac
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Chademo Controller Development

Post by Jack Bauer »

Yeah its just a HV request signal if that makes sense.
I'm going to need a hacksaw
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Chademo Controller Development

Post by Isaac96 »

CHAdeMO VCU from Damien arrived today! Thank you so much!!!

I'll have it wired up in an hour or so and go try it out (just waiting on ISA shunt, that should be here soon enough).
At least I can see how CAN works and whether I set up the I/O correctly.

HV request - that will be in the next version after I've verified correct operation.

-Isaac
Post Reply