BMW i3 CCS/charge port controller

Development and discussion of fast charging systems eg Chademo , CCS etc
davefiddes
Posts: 211
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 35 times

Re: BMW i3 CCS/charge port controller

Post by davefiddes »

I've had another look at the latest version of the code. I think it's doing what you expect it to. The only odd thing I don't understand is the mechanism when the contactors are closed. It seems that this is being set and then immediately advances to lim_state 6. Perhaps lim_state 5 should be like lim_state 4 but with CONT_Ctrl = 0x2; for a couple of seconds as some sort of pre-charge before going to lim_state 6?

The other thought/question I had was do you have CAN logs of what went on for these sessions? Is the code behaving the way you think it is? It wouldn't be the first time that sensible looking code had a mind of its own. The state machine and message sending code is very complex with many timers and difficult to follow just exactly what comes out when.

Hooking CAN TX/RX up to the logic analyser might be handy in future for tying what the LIM is sending vs what you're sending and it's reporting via CAN.

On the topic of Ionity comms. Are the PP/CP wires tightly twisted like a CAN cable? Perhaps the behaviour we're seeing is because its acting like an aerial and picking up stuff from another charger cable. Doesn't explain the behaviour though as I thought that the LIM wouldn't even try PLC without the 5% pilot signal.
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: BMW i3 CCS/charge port controller

Post by Jack Bauer »

In state 4 we request precharge. I did have state 5 dedicated to closing but removed that after realising I should close during precharge not energy transfer! Doh. THe can logs do indeed look to show what I intend but I can take a few more just to be certain.
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 »

Looking over the cirstart pcaps again, it appears the station does precharge in two steps, first to ~195v after ~4s then to pack voltage ~380v ~500ms later. If the LIM is automatically closing in because it determines it is within 20v, it may happen before the high level message from the charger is sent. However on cirstart.pcap the charger was a bit faster (some variation is normal) and managed to squeeze two precharge messages at 377V, so it’s probably not automatic.

I agree that capturing CAN in parallel with the SPI may be a good idea. I think wireshark can also take in CAN in some way, would be cool to decode both in the same file.

Confirmed in the standard you are supposed to close contactors in precharge, then send power delivery request. Sounds like you are doing the right thing here, just too quickly?

Regarding the tritium, I think you only got 7A that one time because it stored the lower max voltage you were incorrectly sending before in charge parameter discovery. I think you’ll get full current next time you try it.
davefiddes
Posts: 211
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 35 times

Re: BMW i3 CCS/charge port controller

Post by davefiddes »

Wireshark has pretty solid CAN support. I'd have to write a set of dissectors to mirror the SavvyCAN .dbc files but it shouldn't take too long. Not sure what happens if you put Ethernet frames and CAN frames in the same file...will give it a go tomorrow.
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: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Jeez Dave is there anything you can't code:)

re the tritium that makes perfect sense now in hindsight of course!

I'll investigate the socket / 5% pilot on the ionity and also have a look at my nasty shutdown code and see if I can make it more friendly.

On another note I have made contact with an Irish owner of a 2019 120ah i3s and will be meeting him this week for a bout of can logging at as many different ccs stations as we can find:) Should help further lift the veil on things.
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: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Thanks to a very kind gentleman we now have a bunch of logs from a 2019 i3s 120Ah on the repo. Logs taken : Startup, mid point and shutdown of Ionity and Efacac CCS stations. Also logged an AC charge and vehicle startup. At the owner's request I have removed messages 0x380 (VIN) and 0x330 (Odometer) from the published logs. Neither are required for LIM operation in any event.
Attachments
2021-06-29 13.30.01.jpg
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: BMW i3 CCS/charge port controller

Post by JaniK »

Jack Bauer wrote: Tue Jun 29, 2021 1:27 pm Thanks to a very kind gentleman we now have a bunch of logs from a 2019 i3s 120Ah on the repo. Logs taken : Startup, mid point and shutdown of Ionity and Efacac CCS stations. Also logged an AC charge and vehicle startup. At the owner's request I have removed messages 0x380 (VIN) and 0x330 (Odometer) from the published logs. Neither are required for LIM operation in any event.
Very nice, do pass on many thanks to the gentleman.
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: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Re Ionity problems. We charged his i3 on my account and it worked fine so no payment/auth issues. I cleaned up around the ccs socket on the E46 and the plug now absolutely bottoms out in the socket. Over CAN the LIM reports seeing a 5% not ready pilot so its safe to say the low level pilot is reaching the LIM. The LIM also detects the PP line. However, the second the plug is inserted the station goes into the "Charging will commence once power is available" crap. The LIM never changes to 5% ready or reports that is has detected CCS type 2 over CAN. Its almost as if the LIM is waiting for something from the station and vice versa and neither wants to go first! I put the state machine in a wait loop to see if something would change but after about a minute the station gives up and reports a "comms error" that I pictured before.

Edit : Poured over the CAN logs from when I was in clown mode with the contactor coil wiring and I am sending the very same can then as I am now. I must have tested on the ionity stations 50 times and it never did this. Station software update???
I'm going to need a hacksaw
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by celeron55 »

Mostly out of curiosity: Does the LIM send some kind of identifying information to the station that could allow the station to ban a vehicle? The good thing about CHAdeMO is that the best the station can do is try to fingerprint the vehicle and probably fail at it at a somewhat high rate.
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: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Most likely yes but I'll let CCSknowitall answer for certain. That said during our captures from the lim at ionity NO info is swapped either way.
I'm going to need a hacksaw
User avatar
muehlpower
Posts: 574
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 102 times

Re: BMW i3 CCS/charge port controller

Post by muehlpower »

celeron55 wrote: Tue Jun 29, 2021 2:26 pm Mostly out of curiosity: Does the LIM send some kind of identifying information to the station that could allow the station to ban a vehicle? The good thing about CHAdeMO is that the best the station can do is try to fingerprint the vehicle and probably fail at it at a somewhat high rate.
the station always has the MAC address of the LIM, and there is only one.
mikeselectricstuff
Posts: 120
Joined: Sun Nov 08, 2020 11:33 am
Been thanked: 2 times

Re: BMW i3 CCS/charge port controller

Post by mikeselectricstuff »

muehlpower wrote: Tue Jun 29, 2021 3:18 pm
celeron55 wrote: Tue Jun 29, 2021 2:26 pm Mostly out of curiosity: Does the LIM send some kind of identifying information to the station that could allow the station to ban a vehicle? The good thing about CHAdeMO is that the best the station can do is try to fingerprint the vehicle and probably fail at it at a somewhat high rate.
the station always has the MAC address of the LIM, and there is only one.
ISTR reading somewhere that at least one car manufacturer didn't use unique MACs.
Also I wonder if the high-level software that handles admin etc. for the operator can actually access the MAC, which lives many layers deep in the comms stack.
davefiddes
Posts: 211
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 35 times

Re: BMW i3 CCS/charge port controller

Post by davefiddes »

The MAC address is only relevant if the PLC link comes up. With Ionity it never comes up. That we see Ethernet packets from other charging stations when on Ionity indicates that the PLC interface is alive. The LIM is not trying to do any of the PLC initialisation that we see with the other charging stations though. I can't see why. On other chargers the first packet we see over PLC is a HomePlug CM_SLAC_PARM.REQ being broadcast from the LIM. With Ionity this never happens. This is all before any of the PLC security is negotiated too.

Wonder if the problem is related to the issue with not getting any SPI traffic with a 5% PWM pilot on the bench? Something missing in the early CAN setup messages?
paaa
Posts: 209
Joined: Fri Dec 06, 2019 8:59 pm
Location: Dublin & Kilkenny Ireland
Has thanked: 2 times
Been thanked: 11 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by paaa »

Excellent news Damien , glad to see someone with an i3 finally gave you access to one.
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: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Yeah but why did it work before and not now....and this was the first station I ever tested on and it worked then. Gah!
Hmmm...so its the LIM that goes first and on Ionity never does.
I'm going to need a hacksaw
User avatar
muehlpower
Posts: 574
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 102 times

Re: BMW i3 CCS/charge port controller

Post by muehlpower »

I don't know how it works, but in Germany Fastned offers charging without a card or app.

Thay write on there page:
"Warum ist Autocharge nicht für AC- und CHAdeMO-Fahrzeuge verfügbar?
Nur das CCS-Protokoll sendet für jedes Fahrzeug einen eindeutigen Code, was bei Fahrzeugen mit AC- oder CHAdeMO-Stecker leider nicht der Fall ist. Das ist der Grund, warum Autocharge mit diesen Autos nicht verwendet werden kann. "

translated:

"Why is Autocharge not available for AC and CHAdeMO vehicles?
Only the CCS protocol sends a unique code for each vehicle, which is unfortunately not the case for vehicles with AC or CHAdeMO plugs. That is why Autocharge cannot be used on these cars."
davefiddes
Posts: 211
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 35 times

Re: BMW i3 CCS/charge port controller

Post by davefiddes »

Jack Bauer wrote: Tue Jun 29, 2021 5:49 pm Yeah but why did it work before and not now....and this was the first station I ever tested on and it worked then. Gah!
Hmmm...so its the LIM that goes first and on Ionity never does.
Sounds like something changed in your code (I know, it's always a compiler bug or a charging station SW change ;)). Would it be possible to find out what code was running when you had it work and then the first failure and narrow down the changes. On the basis of what we know the failure has to be before any of the high-level CCS messages start flowing. If you had CAN logs that might help even if only to pinpoint the exact date/time of the success/failure.

I could look at creating a SPI analyser for the QCA7000 to look at registers...not something I'd look forward to but if it would help. The problem may lie elsewhere though in the LIM logic and we only have Ionity failures with SPI captures.
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: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Yeah I've heard of that. PlugCharge I think its called. Thing is we never get to TCP comms on Ionity for it to even look for data like that. Here are the exact steps in the sequence.

1)open cp door
2)plug in. At this point car wakes, 5% not ready pilot is detected.
3)Authenticate with app or rfid tag
4)station displays "Charging will commence once power is available"
5)After approx 1 min station times out and pilot goes static. Station reports "comms error. Car must be switched off" pictured above.

If I open door and authenticate BEFORE plugging in it will go to the "Charging will commence once power is available" screen the instant the plug is inserted and times out as above.

tomorrow I'll feed the car 5% pilot here at home and see if anything pops up on spi.
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: BMW i3 CCS/charge port controller

Post by Jack Bauer »

In this can log it got to state 5 and failed as I had the contactor coils misswired :
https://github.com/damienmaguire/BMW-i3 ... ionity.csv

In this log it fails with the "Charging will commence once power is available" screen :
https://github.com/damienmaguire/BMW-i3 ... _e461.2csv
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: BMW i3 CCS/charge port controller

Post by JaniK »

Jack Bauer wrote: Tue Jun 29, 2021 6:15 pm Yeah I've heard of that. PlugCharge I think its called. Thing is we never get to TCP comms on Ionity for it to even look for data like that. Here are the exact steps in the sequence.

1)open cp door
2)plug in. At this point car wakes, 5% not ready pilot is detected.
3)Authenticate with app or rfid tag
4)station displays "Charging will commence once power is available"
5)After approx 1 min station times out and pilot goes static. Station reports "comms error. Car must be switched off" pictured above.

If I open door and authenticate BEFORE plugging in it will go to the "Charging will commence once power is available" screen the instant the plug is inserted and times out as above.

tomorrow I'll feed the car 5% pilot here at home and see if anything pops up on spi.
Here is the answer from ionity: (you propably have seen this...)

"Recommended action: Move the connector/plug up slightly and push it firmly into the car's charging port. Hold the connector/plug firmly in the car's charging port for a few seconds, until it gets locked. In case of a problem, please unplug the connector/plug from your car and return it to the charger. Restart the process."

Hint, until it gets locked.

(...But)

I have actually seen this type of "hold the cable" thing in Teslabjörns videos too, and IIRC there once was a brand new car he tested that had a problem that the plug had to be supported until it locks or it didn't start..

And I have a "dejavu" type feeling I have done this once on a Tesla supercharger quite recently when it didn't start at first, took off plug, retried with holding the plug slightly upwards and pushing in and then it worked.

May sound too easy, but doesn't cost to test of not done yet.

(I would think it may actually want a car side confirmation about power available on car side of the plug and it doesn't work if it has any contact issue?) It just sounds like that to me.
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
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 »

celeron55 wrote: Tue Jun 29, 2021 2:26 pm Mostly out of curiosity: Does the LIM send some kind of identifying information to the station that could allow the station to ban a vehicle? The good thing about CHAdeMO is that the best the station can do is try to fingerprint the vehicle and probably fail at it at a somewhat high rate.
There's two things that can uniquely identify a vehicle in DIN 70121: MAC address (not always unique), and EVCC ID. In the LIM, the EVCC ID is the MAC digits with four zeros before it.

For ISO 15118 there's certificate stuff that authenticate the customer and provide encryption. The 2014 LIM does not support this.

For a multitude of reasons, I don't think your LIM is banned. The only thing I can think of is check your proximity circuit.
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by EV_Builder »

Jack; you have two LIMS did you try the other one? Also if I remember correctly the MAC comm. ended on all zero's, but the device didn't; that means that if all i3's do that a hole bunch of them might be block-listed.

Perhaps it might be useful to buy the Alibaba QualComm chip for station mode instead of EV mode. Doesn't have the chip a mirror or Rx only mode? Then we can view the comms.
My bet: station SW update / timing is off.
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: 87 times
Contact:

Re: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Logs now on the repo for the Circontrol Rapiton 50 with the 2019 i3 :
https://github.com/damienmaguire/BMW-i3 ... C-charging
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: BMW i3 CCS/charge port controller

Post by Jack Bauer »

Hit the E46 with some 5% pilot. SPI cap here :
https://github.com/damienmaguire/BMW-i3 ... dc_e46.sal
Attachments
2021-06-30 10.21.03.jpg
I'm going to need a hacksaw
davefiddes
Posts: 211
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 35 times

Re: BMW i3 CCS/charge port controller

Post by davefiddes »

Interesting. Had a squint at the capture and I see 3 CM_SLAC_PARM.REQ broadcast packets coming from the LIM. So it looks just like the beginning of the HomePlug/PLC startup sequence. The Ionity captures never get this far... So they are being out performed by a resistor and a signal generator. Weird.
Post Reply