Chademo Controller Development

Development and discussion of fast charging systems eg Chademo , CCS etc
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 »

It'll be a long time before they start ripping out chademo chargers at least here in Ireland so someone else can do ccs for now.
I'm going to need a hacksaw
JaniK
Posts: 391
Joined: Sun Aug 25, 2019 12:39 pm
Location: Finland
Has thanked: 49 times
Been thanked: 10 times

Re: Chademo Controller Development

Post by JaniK »

Plus, imagine this:

You drive to an occupied charger, there is car on the CCS plug. You can drive next to it and plug in the chademo to your car and from what I heard some chargers will start Charging chademo, when the CCS is stopped. Or you can watch the charger status on your phone and start it when its free.

But if you have CCS you have to wait for the other car to leave, then drive your car to charger. And I think a lot of people with CCS will prefer 100/150kw CCS over the CCS/chademo combo charger that usually seems to be 50kw..
Any opinions are my own, unless stated otherwise. I take no responsibility if you follow my way of doing things and it doesn't work. Please double check with someone who knows what they are doing.
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 »

What does the code require? Is it just a port of the old Chademo code over to the Due/SAM3X hardware?
If so I can do it, I won't be able to test with ISA but I have SAM3X hardware with CAN and other I/O.

-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 »

Thanks for the support guys. Basically whats needed is :

1)Port the code from the old jld505 to the sam3x.

2)Replace the ina226 derived volt,amp,kwh etc measurements with data from the isa shunt.

3)Delete some of the legacy crap like the 1 wire temp sensors etc.

4)Remap the i/o to the leaf vcu pins. I'll post up a pin map later today for this.

And a "would be nice" - add some data transmitted on serial 2 for a wifi display.
I'm going to need a hacksaw
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 »

Updated pinout with arduino due pin assignment.
Attachments
Chademo_VCU_V1_Pinout.pdf
(206.14 KiB) Downloaded 144 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 »

Jack Bauer wrote: Mon Jul 20, 2020 6:43 am Thanks for the support guys. Basically whats needed is :

1)Port the code from the old jld505 to the sam3x.

2)Replace the ina226 derived volt,amp,kwh etc measurements with data from the isa shunt.

3)Delete some of the legacy crap like the 1 wire temp sensors etc.

4)Remap the i/o to the leaf vcu pins. I'll post up a pin map later today for this.

And a "would be nice" - add some data transmitted on serial 2 for a wifi display.

Sounds good. I'll start by porting and getting it compiling, then take a look at the ISA library and integrating that.
That part should be done by tomorrow (unless work gets in the way). Testing, probably not.
Damien, if I put the code up here can you do a basic functionality test? I'll throw lots of debugging messages in to make that easier.

What's the formatting for the wifi display? 115200 baud rate probably?

-Isaac

EDIT Is SerialUSB (native serial port) used for programming?
Also I'm going to use DueFlashStorage https://github.com/sebnil/DueFlashStorage to save parameters, DueTimer for the processing interrupt.
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 »

Wow that's quick :) In terms of storage the Leaf VCU board does have an external I2C EEPROM fitted. See here for the schematic and also some code that uses the wifi and isa shunt. Might be some help : https://github.com/damienmaguire/Nissan ... Controller

Wifi runs at 19200 baud. Native port is used for programming.
Attachments
E39VCU_v1.zip
(2.89 KiB) Downloaded 97 times
I'm going to need a hacksaw
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 I can do bench and car testing. Much appreciate the help.
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 »

Aight, I'll look at the I2C. Just added in DueFlashStorage but it can come right out (it writes directly to the Due's main flash memory).

Do you still want the SCOTT_BMS and ELCON things in there? I'm not even sure if they're functional with the original code.

Wifi will go in as well, the format looks simple.

-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 »

Please strip out all the bms and elcon stuff. All we want to do is have a voltage and current setpoint. Nice and simple.
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 »

Here's a first test version -- I've stripped out most of the extra functionality. This should be able to run Chademo correctly, and not much else.

It's using the SAM3X EEPROM (which should work, not tested at all). I need to do a little more research before adding the I2C EEPROM - seems like write speeds are very low.
Please test whether parameters actually save.

Serial commands have been reduced, please only use them over SerialUSB else weird things might happen.
Working commands:
V - sets chademo target
VMAX - sets chademo max
AMIN - sets min charge current
AMAX - sets max charge current
CAPAH - sets capacity
CAPKWH - sets KWH capacity
DBG - sets debug level (this one isn't super useful afaik)
SAVE - saves EEPROM
FULLRESET (don't know about this one - it resets the eeprom to the hardcoded values)

z - resets charge state (whatever that means)
p - prints settings
u - updates Chademo with new voltage/current targets


Would you prefer commands to be used over USB or wifi? Either is possible but using both adds a lot of complication.

-Isaac
Attachments
LeafVCUChademo01.zip
(13.34 KiB) Downloaded 119 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 »

Looks fantastic:) Will begin testing. Picked up a chademo port yesterday so will install this on the E39 as this has an ISA shunt fitted. Commands need to go over usb only. Wifi is just for display purposes.

One request would be to move the ISA to CAN0 and leave CAN1 just for chademo as chademo chargers provide one end of the 120 ohm termination.
I'm going to need a hacksaw
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 »

Loaded up on a leaf vcu. Just two observations so far :

1- Had to comment out this line as it was spamming the serial monitor : // SerialUSB.println("Chademo looped");

2- Dueflashstorage seems to lock the flash necessitating use of the erase pin function to clear it for a reprogram.
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 21, 2020 6:45 am Looks fantastic:) Will begin testing. Picked up a chademo port yesterday so will install this on the E39 as this has an ISA shunt fitted. Commands need to go over usb only. Wifi is just for display purposes.

One request would be to move the ISA to CAN0 and leave CAN1 just for chademo as chademo chargers provide one end of the 120 ohm termination.
Done and done.
(also found a typo which might have prevented CAN from working at all, fixed that too).
Jack Bauer wrote: Tue Jul 21, 2020 8:09 am Loaded up on a leaf vcu. Just two observations so far :

1- Had to comment out this line as it was spamming the serial monitor : // SerialUSB.println("Chademo looped");

2- Dueflashstorage seems to lock the flash necessitating use of the erase pin function to clear it for a reprogram.
1. Oops, that was just a debugging thingy. Good thing it works. Removed now.

2. I'll switch it to the i2c EEPROM. EDIT I'm an idiot, was looking at the chademo controller instead of leaf vcu.

Once I have the flash sorted v0.2 will be up.

-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 »

Version 0.2:

-Removed extra debugging
-Removed more legacy garbage
-Moved Chademo to CAN1, ISA is on CAN0
-I2C EEPROM added (no idea if it will work)

Hope it works!

-Isaac
Attachments
LeafVCUChademo02.zip
(12.59 KiB) Downloaded 104 times
JaniK
Posts: 391
Joined: Sun Aug 25, 2019 12:39 pm
Location: Finland
Has thanked: 49 times
Been thanked: 10 times

Re: Chademo Controller Development

Post by JaniK »

How nice to see more people attend to making stuff happen!

Thank you Isaac96!
Any opinions are my own, unless stated otherwise. I take no responsibility if you follow my way of doing things and it doesn't work. Please double check with someone who knows what they are doing.
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 »

Good news is we are reading from the ISA shunt. Seems we have a problem with the menu saving. It wont update no matter what it try e.g. V395 etc. Not just that it wont save to eeprom but it wont update on screen when p brings up the values. But yeah. Great progress and many thanks:)
Attachments
2020-07-22 13.49.29.jpg
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 »

Hmm.. I'll look some more at the EEPROM coding. Not sure if the chip is compatible.
I assume you've verified that the EEPROM on the VCU works in general? If not, try one of the Wire_EEPROM examples (https://github.com/collin80/Wire_EEPROM)

Good to see the ISA reading correctly :)

-Isaac

EDIT I've done some looking through datasheets and schematics... Leaf VCU uses TWI0 for the EEPROM so that should all be correct. Please test functionality of example code.
I am using a struct rather than a class for the settings holder, if the EEPROM works with the example just let me know and I'll switch the Chademo code over.
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 »

Just took another look -- with the EEPROM code removed the settings update correctly.
Are you typing "V395" or "V=395"?
The latter works for me - the "=" is the marker for end of command/start of value.

-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 »

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.
Attachments
2020-07-23 09.22.08.jpg
2020-07-23 09.21.26.jpg
2020-07-23 09.18.46.jpg
I'm going to need a hacksaw
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 84 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 84 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
Post Reply