Tesla Model 3 Charge Port Controller Standalone 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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

Turns out the queue was a terrible idea. But, I have TX working, and Interrupt-based RX working which is awesome. Charge Port ECU shows me a happy white Tesla logo upon door open. I've found a different bug with respect to manual charging being broken, that's a recent thing. Also still get a weird timeout error, though I am 100% certain it's not actually. So I have some stupid logic bug that I've been chasing.

In any case, it's working rather well, and now with a driver that'll actually be maintained.

RTC driver fix tomorrow.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

RTC is better but people are being weird about reviewing it.

It's been a busy week.

In an effort to make my financial situation more comfortable moving forward, I set up "You need a budget", and that took a bit of time to do. :D
I did find some time to finally write some more of the Rust ISA Shunt library.
https://github.com/mdrobnak/isa-ivt-shunt-rs now should be able to process a voltage frame.

Err...I had read the scaling wrong, but it's fixed now. :D So, like I said, that works at least.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

Rust ISA library is much closer now. I was able to simplify it such that it's one routine that deals with the data in a smart way. It's all decoded the same, the only difference is endianness and scaling.

Code: Select all

Input data: 0x0 0x0 0x0 0x0 0x0 0x0
Before processing:
Current: 0
Volt 1: 0
Volt 2: 0
Volt 3: 0
After processing:
Current: 0
Volt 1: 0
Volt 2: 0
Volt 3: 0
Everything is broken : false
Input data: 0x0 0x80 0x0 0x0 0x0 0x0
Everything is broken : true
Change CAN ID:
Current CAN ID: 0x521
Current CAN ID: 0x999
Input data: 0x1 0x0 0x0 0x0 0x88 0xb8
Real data volt 1: 35
Input data: 0x1 0x0 0x0 0x5 0x7f 0x5d
Real data volt 1: 360.285
Input data: 0x0 0x0 0x0 0x0 0x3 0xfe
Real data Current: 1.022
If anyone has any data they'd like to share to test with, that'd be great.

On another note, I received my second charge port, so I can harvest the data connection from it to be able to log SWCAN. I hope to be able to do that by this weekend.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

Ok I wired that up, and went to my local CHAdeMO charging station, and captured the whole session. Voltages were decidedly less than 400V during the charge...
PXL_20210123_012849421.jpg
Notice anything odd?

Note that "Modules" piece. Uh, what?

After the charge was over, there was another one that said "Logs"...then...
PXL_20210123_014741057.jpg
The station was in some sort of Tech mode. Kind of interesting. I was so focused on getting the charge stated and logging that I wasn't paying attention when going through the menu. There was a button to exit the special mode. Glad I didn't. :D

Anyway, I got a capture here. Then went home and installed the "Holiday Update", logging that. Now I'm finishing a short top-off to 50% on AC...then tomorrow I'm pulling all my stuff out of the car, and making that service appointment for the BMS_a035 error.

That said, hopefully I have enough here now to get a little further than before.

Back to squashing warnings on the ZombieVerter code.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

So, I guess I was further along than I thought - it looks like the ramp algorithm from the current voltage to the target voltage is controlled on the EVSE side, not the EV side.

So, uh, CHAdeMO is done. :D At least for 96S NMC batteries. I _think_ the maximum voltage stuff is respected, I need to do more testing there. This may be a showstopper for lower voltage systems. (The BMW CCS setup might work better here, time will tell.)

-Matt
Bryson
Posts: 179
Joined: Sat Jan 25, 2020 6:22 am
Location: California
Has thanked: 1 time
Been thanked: 4 times

Re: Tesla Model 3 Charge Port Controller Standalone Development

Post by Bryson »

Badass! Any idea if we can do 102s or am I just making everything hard on myself?
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

Bryson wrote: Sat Jan 23, 2021 9:38 pm Badass! Any idea if we can do 102s or am I just making everything hard on myself?
If using 4.00 V as the max per cell voltage, that's 408V, which is the default voltage request put out by the adapter. So, no, I think that'd be fine.

That said, sample size of 1 here, so your mileage may vary. :D
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

ISA Shunt is wired up for testing finally. Will start working through my code tomorrow. Will then figure out how to iterate through available on the bus.
Code will do the following:
1) If set up in EEPROM, use that serial number.
2) Otherwise, do device detection.
- If only one device, use that one.
- If more than one device, alert user more configuration is necessary, and show device serial numbers.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

RTC code changes done, waiting on another review.
CAN driver is now upstream, which is nice. I'll update my stuff to use the upstream implementation soon.

Model 3 threw the BMS_a035 again, hopefully service can grab logs this time. Apparently 35 days is too late. Oops. :D

Tomorrow:
ISA Shunt work.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

BAH!

"This library requires the standard library (no_std is currently not supported)." I missed that when I went to use https://docs.rs/byteordered/0.5.0/byteordered/ to help with the Big Endian / Little Endian mess.

Although, I'm not actually using any byte swap features, so maybe just set up my own Struct / Enum lol..back to work.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

Ok, got a quick voltage check in the CHAdeMO charge software, will test it out tomorrow.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

And we have something:
PXL_20210129_044525784.jpg
Two things:
1) I hit into the same bug as Damien in that I didn't handle negative numbers. Oops.

2) The 1,2,3 voltage tap numbering got me - It's actually 3,2,1 from left to right.

But it looks good. I set it to 6V on my cheap power adapter, and got 6.1XX volts on there. (Right after Phase 2: false on the screen)

RTC driver for STM32F4 was merged today, so that's good. No more forked stuff for the moment, but we'll see when I get to other things like the EEPROM.

Tomorrow I'll fix this bug, and start integrating the code into the CP controller.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

Wow.

Soldering SMD to adapter boards SUCKS!

What kind of tools does everyone use for SMD soldering? I am fairly certain I made a complete mess of my first try.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

It looks like I may have not completely messed it up. But still,not great. Now trying to figure out I2C. I see data burst on the scope even when not connected to the board, just clock, so I think the chip is OK. But, usage is a bit of a mystery to me.
User avatar
mayes8229
Posts: 18
Joined: Mon Jan 25, 2021 7:18 am
Location: Durham, NC USA

Re: Tesla Model 3 Charge Port Controller Standalone Development

Post by mayes8229 »

mdrobnak wrote: Sat Jan 30, 2021 3:37 am Wow.

Soldering SMD to adapter boards SUCKS!

What kind of tools does everyone use for SMD soldering? I am fairly certain I made a complete mess of my first try.

-Matt
What part(s) were you trying to put down? You can do anything with:
  • Hot air gun
  • Fine-tipped soldering iron
  • Fine-point tweezers
  • Quality flux (not the plumbing stuff, but you can get away with that)
  • Quality solder
  • Rubbing alcohol and Q-tips for cleaning
Solder wick helps with some mistakes
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

PXL_20210130_015901739.jpg
SOIC-8 EEPROM. I think I did an OK enough job, just dealing with learning how to do I2C programming now. :D But no fun, that's for sure!

I have the hot air gun, but it's one of the wallpaper ones. Works fine for shrink, but too much power and moved the chip too easily. I have terrible tweezers, so that was a mess. But definitely felt like I needed more hands.

-Matt
User avatar
mayes8229
Posts: 18
Joined: Mon Jan 25, 2021 7:18 am
Location: Durham, NC USA

Re: Tesla Model 3 Charge Port Controller Standalone Development

Post by mayes8229 »

Oh yeah those are no problem with a little bit of care. Here's what you need to do if you haven't got a good method yet:
  • Put a little bit of solder on one corner pad (IC is not on the board yet). Keep the rest of the pads dry for now
  • Hold the iron down on the edge of the pad and use tweezers to slide the part onto the hot solder and center the part on all the pads
  • Make sure the part is perfectly flat. If it's not you can put light (very light) pressure on the top of the part and re-flow the solder so it drops down flat
  • Now you just put a little bit of solder on each of the rest of the pads. I usually do the diagonal pin second to make sure nothing will flex. Make sure you heat the pad and the leg together so the solder flows evenly and quickly
  • At this point if the solder filets don't look great you can flux them and re-flow. If there's too much solder use the wick to pull some off or re-flow and clean/scrape the iron a few times to get rid of the excess solder
You don't need a heat gun for this type of package, but one tip for using hot air if you're having trouble with the part moving is to flux the pads before setting the part down. Then the stickiness/surface tension of the flux will help keep it in place until the solder melts. I recommend using tin-lead solder with hot air because the lead-free stuff has to get so hot before it will melt. Takes forever or you risk damaging the board/part if you crank up the heat.

If any of that's not clear I can make you a video soldering a part just like that
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by mdrobnak »

That's really awesome tips. I'll definitely re-read that if I end up having to re-do this mess. :D

ISA IVT-S shunt library updated - supports out of the box configuration correctly now. Next item would be to get the serial # correctly and store that in a list of say 4 items such that we could support 4 per instantiation of the object (which practically speaking would be per bus).

That's it for tonight though.

-Matt
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by EV_Builder »

Sorry for my laziness, but where does this development stand?
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by Jack Bauer »

Some good news that I meant to post about this actually. A friend living nearby has purchased an M3. Just waiting on an inductive can pickup to arrive then its off for some hvs can logging on ccs:)
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: 33 times
Contact:

Re: Tesla Model 3 Charge Port Controller Standalone Development

Post by EV_Builder »

ooeeehh thats increasing the odds of succes balisticly...nice!
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by Jack Bauer »

aannnd its here. Very kindly donated by forum member paaa. Contacted my friend with the M3. we are good to go for next week. Now I just need to find the easiest way into the hvs can wiring. Any pictures would be great:)
Attachments
2021-05-07 11.34.09.jpg
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by Jack Bauer »

We got logs :
https://github.com/damienmaguire/Tesla- ... CP_CAN_CCS

Ended up not half as hard to get to the CP ecu as I had thought. Only had to remove 2 pieces of trim and pull back the carpet. Rather then mess about with the inductive can unit I just stuck two wires into the back of the car side connector on the cp ecu.

We did the following :
1)open and close the charge port flap
2)CCS at 44kw (probably charger side limited because Ireland)
3)AC charge
4)Drive a few hundred metres,
5)Damien drive Model 3 for the first time :) :) :)

Car is a 2020 55kwh single motor right hand drive model.

E46 Touring is an excellent service vehicle:)
Attachments
2021-05-13 10.43.38.jpg
2021-05-13 10.39.14.jpg
2021-05-13 10.35.51.jpg
2021-05-13 10.30.54.jpg
2021-05-13 10.30.39.jpg
2021-05-13 10.30.34.jpg
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by Jack Bauer »

First finding 0x244 reports FC limits from the charge point. In this case :
Max power 50kw
max voltage :500v
min voltage: 50v

I sure would love to try ccs charging a low voltage car:) I'd nearly bet the Panzer it would crap out...
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: Tesla Model 3 Charge Port Controller Standalone Development

Post by JaniK »

Wow, here is something hot going on.
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.
Post Reply