Chademo Controller Development

Development and discussion of fast charging systems eg Chademo , CCS etc
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

Guys i have a problem!

I am using Leaf VCU repurposed for chademo. Now this VCU ran absolutely fine without any problems.
Today i plugged external USB cable to its usb pins. At first i got good serial connection, but as i tried to reupload the code Arduino couldnt sense the chip and inside my PC i got Bossa programming port instead of Arduino programming port!

Anyone knows what should be done?

tnx
User avatar
larsrengersen
Posts: 101
Joined: Tue May 28, 2019 9:42 am
Has thanked: 8 times
Been thanked: 22 times

Re: Chademo Controller Development

Post by larsrengersen »

Then it has triggered ‘programming mode’ and is ready to receive the .bin file.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

larsrengersen wrote: Sat Aug 20, 2022 4:43 pm Then it has triggered ‘programming mode’ and is ready to receive the .bin file.
OK, but how if Arduino IDE wont see it as a port?
My PC sees it as Bossa programming port....

Or better yet, how to get it out of the programming mode?
See on the photo, IDE sees the chip but it cant upload...
Attachments
Untitled.jpg
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

I managed to upload .bin file via bossa utility, but i cant get any serial data as i power the VCU.
It is still recognised as Bossa programming port.

Did i mess the bootloader?
User avatar
larsrengersen
Posts: 101
Joined: Tue May 28, 2019 9:42 am
Has thanked: 8 times
Been thanked: 22 times

Re: Chademo Controller Development

Post by larsrengersen »

Does power cycling change anything?
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

larsrengersen wrote: Sat Aug 20, 2022 5:47 pm Does power cycling change anything?
No if i remove power and add it i still get bossa programming port on com16
Also i dont get any CAN comms on either port. Should that mean flash is frozen? How to untangle this?

EDIT: I get this when i try to upload sketch
Send auto-baud
An error occurred while uploading the sketch

Set binary mode
readWord(addr=0)=0x20001000
readWord(addr=0xe000ed00)=0x412fc230
readWord(addr=0x400e0740)=0
readWord(addr=0x400e0940)=0x285e0a60
version()=v1.1 Dec 15 2010 19:25:04
chipId=0x285e0a60
Connected at 115200 baud
readWord(addr=0)=0x20001000
readWord(addr=0xe000ed00)=0x412fc230
readWord(addr=0x400e0740)=0
SAM-BA operation failed
readWord(addr=0x400e0940)=0x285e0a60
Atmel SMART device 0x285e0a60 found
write(addr=0x20001000,size=0x34)
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

Hurah!!!
I have a sucess!

1. I went and changed SAM drivers inside Arduino to 1.6.5, they are supposedly the most stable
2. System still offered me Bossa programming port on com16
3. I played with Bossac.exe file and disabled flash boot (enabled ROM boot), dont know if this caused next event or not...
4. Inside IDE I set "Arduino DUE native USB port" and selected COM16, IDE found a device on port16
5. I compiled code and after a very long time it started to upload and in the end fixed the chip in reset!
6. I pushed the reset on the board and IDE couldnt find the chip on port16, it was on port18 and it said propperly Arduino on COM18

I get a good serial now and i bet CAN bus too.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

Finally the fruits of my labour...
I mounted the box to the place of exhaust. Self sustained no power from the car required. Apart from solid GND. I intend to test this a bit. In the end i will probably add CAN line to BMS for protection.

I intend to simply use a heartbeat telegram similar to Outlanders 0x285 to keep chademo operating. If that would be missing VCU would stop.

Edit: that rust does not belong there 😁. I guess there is no inox welding wire. I have to sort it out before winter.
Attachments
20220821_185708.jpg
20220821_185654.jpg
20220821_185641.jpg
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 »

Who is using The STM32 ISA CAN version with great success?
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.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

Yesterday a friend of mine lent me his Leaf 2018 for me to play my CAN games on. :twisted:
Mission was to connect to Chademo port while charging and spy on the traffic.
Sorry for no photos as we had limited time to try this out.
First we opened the bonnet and inspected the CHADEMO socket for its CAN twisted pair. We located it easily by its pink/white colour wires. Then i traced those wires to the next connector which i unpluigged and fitted with my needle probes behind the pin seal. When we tried to start CHADEMO by pulling pin 7 to GND i got good CAN on the lines.
We went to one uberfast Chademo/CCS station, i activated it and used my Canalyst to record traffic to my laptop.

Findings:
Our DIY VCU does not include complete Chademo traffic

MSGID B0 B1 B2 B3 B4 B5 B6 B7
0x700 01 02 00 00 06 00 00 00 //this one is some sort of identifier
0x100 06 00 00 00 B3 01 FF 00 //this one i dont remember from before
0x101 00 FF 4D 00 00 00 00 00
0x102 02 9A 01 7D 00 81 59 00
0x200 FF 00 00 00 FA 00 1A FF //this one is also new
0x110 01 00 00 00 00 00 00 00
0x201 02 00 00 00 00 00 00 00
0x202 01 01 01 00 00 00 00 00
0x108 00 F4 01 7D B3 01 00 00
0x109 01 6E 01 7D 01 05 FF 4D
0x208 FF AA 00 FF 00 00 AA 00 //Possibility of charging V2G or V2H?
0x209 01 00 00 00 00 00 00 00
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: Chademo Controller Development

Post by Bigpie »

0x700 byte 0 is apparently the automaker code.
0x200 & 0x201 are V2X

https://github.com/dalathegreat/leaf_ca ... AN_ALL.dbc
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: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

I went on and changed some calls and add a function CANID in chademo.h and chademo.cpp files

chademo.h

Code: Select all

//The IDs for chademo comm - both carside and EVSE side so we know what to listen for
//as well.
#define CARSIDE_BATT_ID			0x100
#define CARSIDE_CHARGETIME_ID	0x101
#define CARSIDE_CONTROL_ID		0x102
#define CARSIDE_ID		0x700
....

    void sendCANStatus();
    void sendCANBattSpecs();
    void sendCANChargingTime();
    void sendCANID();
chademo.cpp

Code: Select all

if (bChademoSendRequests && bChademoRequest)
    {
      bChademoRequest = 0;
      frameRotate++;
      frameRotate %= 4; // corrected to 4 cases with carID
      switch (frameRotate)
      {
        case 0:
          sendCANStatus();
          break;
        case 1:
          sendCANBattSpecs();
          break;
        case 2:
          sendCANChargingTime();
          break;
        case 3:
          sendCANID(); //car ID report for EVSE
          break;
      }
    }
.....

void CHADEMO::sendCANID() //Car ID function CAN ID 0x700 
{
  CAN_FRAME outFrame;
  outFrame.id = CARSIDE_ID; //ID 700 01 02 00 00 06 00 00 00 Nissan Leaf
  outFrame.extended = false;
  outFrame.length = 8;

  outFrame.data.byte[0] = 0x01; 
  outFrame.data.byte[1] = 0x02; 
  outFrame.data.byte[2] = 0x00; 
  outFrame.data.byte[3] = 0x00; 
  outFrame.data.byte[4] = 0x06; 
  outFrame.data.byte[5] = 0x00; 
  outFrame.data.byte[6] = 0x00; 
  outFrame.data.byte[7] = 0x00; 
  //CAN.EnqueueTX(outFrame);
  Can1.sendFrame(outFrame);
  if (settings.debuggingLevel > 1)
  {
    SerialUSB.print(F("CAR: ID"));
    timestamp();
  }

}
I got message with ID 0x700 out on connection.
Then i went to some EVSE... First i tried at ABB charger where i didnt have any problems. Yes again it worked good.
Next i went to the infamous ultra charger and tried. After somewhat long pause after connection it showed an error.
BUT this time it said "check connector, no CAN connection" or something to that effect. It is the first time it actually stated the nature of the error.
So my problem is along the CAN lines!!!

I will remove my box and inspect how is the CAN terminated. Maybe that is the problem.
Dusty4
Posts: 83
Joined: Tue Dec 25, 2018 12:41 pm
Location: Western Australia
Has thanked: 11 times
Been thanked: 7 times

Re: Chademo Controller Development

Post by Dusty4 »

Hey Guys, I've set up a due with bigpies shield in the wiki. Testing on a nearby charger it stops charging after almost exactly 2mins every time I test it. Its a Tritium PK350 "ultra rapid charger". Has anyone else had a similar issue? I'm Planning on testing on the next closest station tomorrow, unfortunately its 40km away :roll: .
Attached is a screenshot of when it stopped.
Attachments
Screenshot 2022-09-18 195240.png
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: Chademo Controller Development

Post by Bigpie »

Which version did you use? V1 had a few mistakes that needed correction:D
If V1, R4 needs to be a solder bridge, R7 needs removing. IN2 needs a 1k pull up to 3.3v adding too. I've also changed IN2 to use pin 5 vs pin 6 as I've blown pin 6 on my due.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Dusty4
Posts: 83
Joined: Tue Dec 25, 2018 12:41 pm
Location: Western Australia
Has thanked: 11 times
Been thanked: 7 times

Re: Chademo Controller Development

Post by Dusty4 »

Using V2 :) The charger stops at exactly 2mins everytime, I'm thinking a compatibility issue. I'll get a CAN log over the next few days.
One thing I found on the V2 board is the 3v3 wasn't connected to the can transceivers, The traces are there but a through hole is missing to join them. Great job on the board though, it's a neat little solution.
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: Chademo Controller Development

Post by Bigpie »

Doh, I'll update that, I've not actually got round to ordering v2 boards yet :D. A can log would be good and also if you do DBG=3 before starting it'll spew out more info too.
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
jason_arnold
Posts: 21
Joined: Wed Sep 11, 2019 4:42 pm
Location: Canada
Has thanked: 1 time
Been thanked: 2 times

Re: Chademo Controller Development

Post by jason_arnold »

Bigpie wrote: Wed Sep 21, 2022 3:24 pm Doh, I'll update that, I've not actually got round to ordering v2 boards yet :D. A can log would be good and also if you do DBG=3 before starting it'll spew out more info too.
Oh, if you're doing a minor rev on the board, I wanted to mention that the EasyEDA DRC checker complains about the last two traces of net D48 running to U5 - both are currently 2.45mm, so I'm guessing it's just a typo since the minimum trace width is 2.54mm? It's also complaining about some of your vias on the 3V3 net, but assuming those will get sorted as part of Dusty4's revelation?
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: Chademo Controller Development

Post by Bigpie »

Should be ok now, hopefully.
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: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

While i was charging at 100A my battery filled up fast and voltage raised to VMAX value of 390Vdc.
There Chademo stopped charging and shut down.
Immediately voltage droped and i was left with some 76% at 378Vdc.

This just wont do! I want to be able to have some current tapering at least at the last 10% of charge.

So i went to study the code and inside chademo.cpp file i found the routine to transmitt askingAmps parameter within CAN telegram.
Then i inserted a conditional to observe voltage and reduce askingamps when voltage would get above preset value.

Code: Select all

  if (Voltage > (settings.targetChargeVoltage - 2)) {
      askingAmps == settings.minChargeAmperage;  
  } 
I set minimal amps to 20A for testing.
I had some problems with parameter declarations and i decided to keep the old parameters and condition them by some parts.

I will let you know how testing goes tomorrow...
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

Crap! I couldnt get any reduction at EVSE with previous code.
I will try with direct values.

@isaac96 could you elaborate how could we taper down charging by reducing amps in mid charge?

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

We use the targetCurrent variable to reduce charge current.

Code: Select all

if (Count == 20)
    {
      if (evse_status.presentVoltage > settings.targetChargeVoltage - 1) //All initializations complete and we're running.We've reached charging target
      {
        //settings.ampHours=0; // Amp hours count up as used
        //settings.kiloWattHours=settings.packSizeKWH; // Kilowatt Hours count down as used.
        if (settings.minChargeAmperage == 0 || carStatus.targetCurrent < settings.minChargeAmperage) {
          //putt SOC, ampHours and kiloWattHours reset in here once we actually reach the termination point.
          settings.ampHours = 0; // Amp hours count up as used
          settings.kiloWattHours = settings.packSizeKWH; // Kilowatt Hours count down as used.
          chademoState = CEASE_CURRENT;  //Terminate charging
        } else
          carStatus.targetCurrent--;  //Taper. Actual decrease occurs in sendChademoStatus
      }
      else //Only adjust upward if we have previous adjusted downward and do not exceed max amps
      {
        if (carStatus.targetCurrent < settings.maxChargeAmperage) carStatus.targetCurrent++;
      }
    }
The change then propagates to sendCANStatus() where askingAmps is decreased if greater than targetCurrent. askingAmps is the real request going to the EVSE.


VMAX is a protection setting, so if voltage hits that level the charge will shut down. Use V=(desired setting) to configure your desired charge voltage.

It's been some time since I played with this code. Last time I had Chademo working I ran into issues with overheating EVSEs (it was 100F out) ramping current down and the software didn't like it, I made changes to fix that but haven't gotten those into the published version.
User avatar
CCSknowitall
Posts: 105
Joined: Fri Jun 04, 2021 1:47 pm
Has thanked: 1 time
Been thanked: 28 times

Re: Chademo Controller Development

Post by CCSknowitall »

Isaac96 wrote: Wed Sep 28, 2022 10:22 pm Last time I had Chademo working I ran into issues with overheating EVSEs (it was 100F out) ramping current down and the software didn't like it, I made changes to fix that but haven't gotten those into the published version.
Highly recommend implementing this as a number of CHAdeMO stations will adjust their max amps due to temp or available power modules. Most notably the Tritium Veefil 50kW units.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

Isaac96 wrote: Wed Sep 28, 2022 10:22 pm VMAX is a protection setting, so if voltage hits that level the charge will shut down. Use V=(desired setting) to configure your desired charge voltage.

It's been some time since I played with this code. Last time I had Chademo working I ran into issues with overheating EVSEs (it was 100F out) ramping current down and the software didn't like it, I made changes to fix that but haven't gotten those into the published version.
HM... so it would be desirable that settings.maxChargeVoltage would be set lower than settings.targetChargeVoltage?
I guess i attributed a lot more importance to settings.maxChargeVoltage when it just seems to be a limit when tapering occurs.
Can you confirm this logic for me?
So if i set settings.maxChargeVoltage = 390V and settings.targetChargeVoltage = 392V askingAmps would be reduced down to minChargeAmperage by holding maxChargeVoltage steady. Then charging process would stop. Thus i could charge up to 390V and current would taper down to 10A if i would set minChargeAmperage so?

If it works like this then i just need to correct my settings :). Maybe i will set a comment in wiki too.

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

arber333 wrote: Thu Sep 29, 2022 6:57 am HM... so it would be desirable that settings.maxChargeVoltage would be set lower than settings.targetChargeVoltage?
I guess i attributed a lot more importance to settings.maxChargeVoltage when it just seems to be a limit when tapering occurs.
Can you confirm this logic for me?
So if i set settings.maxChargeVoltage = 390V and settings.targetChargeVoltage = 392V askingAmps would be reduced down to minChargeAmperage by holding maxChargeVoltage steady. Then charging process would stop. Thus i could charge up to 390V and current would taper down to 10A if i would set minChargeAmperage so?

If it works like this then i just need to correct my settings :). Maybe i will set a comment in wiki too.

tnx
Other way around. settings.targetChargeVoltage is the CV limit, settings.maxChargeVoltage is the 'safety valve'.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Chademo Controller Development

Post by arber333 »

Isaac96 wrote: Thu Sep 29, 2022 2:10 pm Other way around. settings.targetChargeVoltage is the CV limit, settings.maxChargeVoltage is the 'safety valve'.
Hm... no i tries that already and it just stoped charging. No tapering of current... this is why i wanted to setup tapering.

Do you think i should setup greater difference? As in 390V for charge and 394V for max?
Post Reply