BMW i3 CCS/charge port controller

Development and discussion of fast charging systems eg Chademo , CCS etc
Post Reply
MattsAwesomeStuff
Posts: 921
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 317 times
Been thanked: 194 times

Re: BMW i3 CCS/charge port controller

Post by MattsAwesomeStuff »

I haven't written code in 15+ years, and only ever at a very casual level. Going through Damien's code there is awkwardly scratching an itch I didn't think I would still have.
User avatar
muehlpower
Posts: 592
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 107 times

Re: BMW i3 CCS/charge port controller

Post by muehlpower »

Jack Bauer wrote: Wed Jun 02, 2021 1:45 pm I've setup a new branch on the vcu repo called ACDC_LIM.
can someone explain what that means
User avatar
chrskly
Posts: 149
Joined: Fri Feb 21, 2020 5:04 pm
Location: Dublin, Ireland
Has thanked: 40 times
Been thanked: 39 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by chrskly »

muehlpower wrote: Thu Jun 03, 2021 4:40 pm
Jack Bauer wrote: Wed Jun 02, 2021 1:45 pm I've setup a new branch on the vcu repo called ACDC_LIM.
can someone explain what that means
I think he means here : https://github.com/damienmaguire/Stm32- ... e/ACDC_LIM
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

For those struggling with Git (namely me!) I can recommend github desktop for windoze and linux. Makes you a git master in 5 minutes:)
https://desktop.github.com/
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: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Got some fresh logs on the repo. 2013 i3 rex. Switched on in park.
I'm going to need a hacksaw
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 34 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by EV_Builder »

muehlpower wrote: Thu Jun 03, 2021 4:40 pm
Jack Bauer wrote: Wed Jun 02, 2021 1:45 pm I've setup a new branch on the vcu repo called ACDC_LIM.
can someone explain what that means
Repo= repository a place where an software project is initiated in order to keep tracking changes etc.

Branch= a branch is like a version of the software / clone which has certain differences in relation to the main branch. So imagine you write a book and you doubt about the addition of a story, so you think: ok I write two versions. Then you branch and proceed with the book. At a certain point in time you want to include that story...then you "merge to develop". Now if someone else wrote that extra story he sends you a "pull request" so you can pull that story in, check it and merge it with develop. It's also possible to just develop further on the branch until you think time to release this (make it stable) or merge it to develop (you stop maintaining both book stories)..

The hole idea of version administration is keeping track of changes and reasoning the why , who and when.

Hope to have shed some light in the darkness..
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Alrighty, first big thanks to davefiddles for cleaning up my disaster code into something that will impress the investors...ehhh ...I mean help the community better understand. Now as from yesterday we get to state 2 where the main event is commanding the charging phase in 0x2fa bits 20-23 to go from 0x1 initialisation to 0x9 which looking at the logs seems to indicate this is when weld detect happens. That said the info I have on that message is :
0x0 Standby
0x1 Initialisation
0x2 Subpoena
0x3 Energy transfer
0x4 Turn off
0xF Reserved
0xE Reserved
0xF Invalid signal

So no 0x9. Makes me think I am either messing up my bits in that area or its a difference between type 1 LIM/CCS as this is what the logs are from and type 2 that I am using. Any thoughts?
I'm going to need a hacksaw
User avatar
muehlpower
Posts: 592
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 107 times

Re: BMW i3 CCS/charge port controller

Post by muehlpower »

what is the value for "CHGNG_TYP_IMME", 4 = DC charging with DC pins via type 1 combo socket, 9 = DC charging with DC pins via type 2 combo (core) charging socket

before the value will be 0, in your case it should switch to 9, in the logs it is 4, cause it is a US version
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 34 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by EV_Builder »

muehlpower wrote: Fri Jun 04, 2021 9:44 am what is the value for "CHGNG_TYP_IMME", 4 = DC charging with DC pins via type 1 combo socket, 9 = DC charging with DC pins via type 2 combo (core) charging socket

before the value will be 0, in your case it should switch to 9, in the logs it is 4, cause it is a US version
Would the USA version be compatible anyway?
Is there in the handshake a request type to the charger?
(With other words if we command ourselves that we want type 1).
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Yesterday we only got to state 2.
Today we got to state 5:)

Still failing to make it to state 6 where we can request power but so close:)
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: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Nice to see the charge station lying about its minimum voltage:)
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: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Got your problem right here lady! We were going to energy transfer mode before closing contactors. On examining the logs more closely we command close then go to energy transfer!
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: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

So much for that. Hit my local ionity hub where I could sit on one for a while without getting charger raged by fellow BMW drivers ...
Still getting the same dropout at state 4 to 5 where we try to close contactors.
Can log here : https://github.com/damienmaguire/BMW-i3 ... ionity.csv

For some reason the ionity charger pushes up to 394v on precharge when the batt voltage reported in 0x112 is 372v. Also not sure if I'm sending the right contactor command. seems to be 0 for off and 2 for on in the logs.
I'm going to need a hacksaw
User avatar
muehlpower
Posts: 592
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 107 times

Re: BMW i3 CCS/charge port controller

Post by muehlpower »

Jack Bauer wrote: Fri Jun 04, 2021 2:43 pm So much for that. Hit my local ionity hub where I could sit on one for a while without getting charger raged by fellow BMW drivers ...
Still getting the same dropout at state 4 to 5 where we try to close contactors.
Can log here : https://github.com/damienmaguire/BMW-i3 ... ionity.csv

For some reason the ionity charger pushes up to 394v on precharge when the batt voltage reported in 0x112 is 372v. Also not sure if I'm sending the right contactor command. seems to be 0 for off and 2 for on in the logs.
I think you have to adjust the voltage limit in 2F1h to the battery voltage

0=open immediately
1=open with diagnosis
2=close
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

I am such a clutz!
Anyway, here is a video to distract you from my moronity:
I'm going to need a hacksaw
User avatar
CCSknowitall
Posts: 105
Joined: Fri Jun 04, 2021 1:47 pm
Has thanked: 1 time
Been thanked: 28 times

Re: BMW i3 CCS/charge port controller

Post by CCSknowitall »

Jack Bauer wrote: Fri Jun 04, 2021 2:43 pm For some reason the ionity charger pushes up to 394v on precharge when the batt voltage reported in 0x112 is 372v. Also not sure if I'm sending the right contactor command. seems to be 0 for off and 2 for on in the logs.
Hi! Started following this from Demian's youtube channel. I work in the industry and know the CCS protocol, if you need help there.

The high precharge voltage may be normal for that brand/model of charger. It's called overshoot. In CCS, the station has 7 seconds to get it's act together and be within +/- 5V of the pack voltage (original CCS spec was within 20V). Depending on the converter design, some shoot up and come down, others come up in steps. Most stations take about 3-4 seconds to come to the right voltage, but some are longer.

Do you decide when to close in or is that handled by the LIM? If you do, wait for 7 seconds and see if it comes down within the proper range. If it stays steady at the wrong voltage, you may need to confirm you are sending the correct target voltage.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Many thanks:)
I'm going to need a hacksaw
MattsAwesomeStuff
Posts: 921
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 317 times
Been thanked: 194 times

Re: BMW i3 CCS/charge port controller

Post by MattsAwesomeStuff »

CCSknowitall wrote: Sat Jun 05, 2021 2:39 amI work in the industry and know the CCS protocol, if you need help there.
Hi, welcome to the community Mr. KnowItAll. :P

Damien often shoulders 90%+ of the engineering on these projects himself, and lots of it I imagine to be frustrating guesswork. Having someone around to contribute on that I'm sure would make a world of difference. Thanks for stepping up!
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Well, today was a bit frustrating if I'm honest. Spent hours trying to convince the LIM to perform a contactor weld test without success. That said I did manage to clear an error in 0x272 relating to contactor status. Sadly no better off in regards to the ccs process. As soon as we ask the LIM to close contactors it shutsdown.
I'm going to need a hacksaw
User avatar
FJ3422
Posts: 116
Joined: Fri Jul 10, 2020 9:55 am
Location: Netherlands
Has thanked: 1 time
Been thanked: 1 time

Re: BMW i3 CCS/charge port controller

Post by FJ3422 »

Jack Bauer wrote: Sat Jun 05, 2021 6:50 pm As soon as we ask the LIM to close contactors it shutsdown.
Are you supplying enough power on the 12V to the LIM ? Initial coil current might be as large as 3-4Amps (*2) for 100-500ms, where hold-current is usually around 1/10 to 1/5 of that.
User avatar
CCSknowitall
Posts: 105
Joined: Fri Jun 04, 2021 1:47 pm
Has thanked: 1 time
Been thanked: 28 times

Re: BMW i3 CCS/charge port controller

Post by CCSknowitall »

I’m not sure if the LIM weld detection test is similar to what’s in the CCS standard but if it is, it actually occurs after a charge is complete, not before (or separately, I think, unless done by a dealership tool as part of diagnostics). So you may be trying to do something out of sequence that the LIM doesn’t like.

Welding detection request uses the EVSE connector voltage sensors along with the vehicle inlet voltage sensors to verify there’s no voltage on the vehicle inlet after a charge and the contactors have opened. The LIM would receive the EVSE voltage readings via plc. Since it occurs at the end of charge, if you are commanding this during precharge or charge you’re likely to get ether a valid high voltage from the EVSE or an error message over plc of some sort (and likely a fault too). If you’re doing this on the bench without a charging station, you’ll likely get an internal error from the LIM since it’s not actively talking to a station.

Note the weld detection is optional in the spec, it’s up to the vehicle to ask the station for this measurement after the charge stops. I don’t know if the LIM automatically asks for it every time or you can command it over CAN.
User avatar
CCSknowitall
Posts: 105
Joined: Fri Jun 04, 2021 1:47 pm
Has thanked: 1 time
Been thanked: 28 times

Re: BMW i3 CCS/charge port controller

Post by CCSknowitall »

Jack Bauer wrote: Wed Jun 02, 2021 5:57 pm So I made myself a little Savvycan special and stepped through the DC logs. A start sequence looks like :
DC Sequence : On detect 5% pilot Chg status goes to 1 and Chg req goes to 1. Target phase standby.
Next step : Target phase initialisation
Set chg power forecast (49050W in logs). Target phase to 9 (unknown?). At this point we switch from 5% to greenphy. Chg readiness to 1.
Contactor weld test begins.Set end of charge timer. V ramps to 410v and holds for a few seconds.
Voltage ramps down to 0 and afer a few seconds we go target phase Subpoena (precharge).
Once contactor measured volts matches batt voltage in 0x112 we go contactor command 2 in 0x3e9 and target phase to energy transfer.
Start sending current command and party hard!
I realize here you say “contactor weld test”. That’s not what that stage is called, it is called cable check. The HV is for the station to check the integrity of the cable, inlet, and associated wiring to the pack. Are you getting stuck at cable check?

What I’m trying to figure out is how much of this state machine is “automatic” vs something you have to step through via can. There’s a few different parts of the initialization that you can’t really be too far off in timing. The vehicle actually sends the first cable check request, right after the station says it has finished charger parameter discovery. In general, if you don’t respond within 800ms to a message you’ll fault the station.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Thanks very much for joining up a sharing your knowledge. From what I can tell the LIM does a lot of the work by itself. I am consistently failing at the end of precharge where I command contactors to close. The lim then terminates the session so I'm fairly sure its not happy about either a)something in the can messages I'm sending or b)the precharge voltage being too far off the measured battery voltage.
I'm going to need a hacksaw
User avatar
muehlpower
Posts: 592
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 107 times

Re: BMW i3 CCS/charge port controller

Post by muehlpower »

Jack Bauer wrote: Sun Jun 06, 2021 6:47 am Thanks very much for joining up a sharing your knowledge. From what I can tell the LIM does a lot of the work by itself. I am consistently failing at the end of precharge where I command contactors to close. The lim then terminates the session so I'm fairly sure its not happy about either a)something in the can messages I'm sending or b)the precharge voltage being too far off the measured battery voltage.
Are you using the 2017+ LIM or the older one and is the voltage sensing board from the same car or did you mix it? Your CAN log looks like the old one (no 2EEh).
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 88 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Using the 2017+ LIM...well it says 2017-12-01. Voltage board I'm not sure what car it came from.
I'm going to need a hacksaw
Post Reply