Tesla Model 3 Charge Port Controller Standalone Development
- 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
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
In any case, it's working rather well, and now with a driver that'll actually be maintained.
RTC driver fix tomorrow.
-Matt
- 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
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.
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.
So, like I said, that works at least.
-Matt
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.

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.

-Matt
- 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
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.
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
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
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
- 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
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...
Note that "Modules" piece. Uh, what?
After the charge was over, there was another one that said "Logs"...then... 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.
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
Notice anything odd?Note that "Modules" piece. Uh, what?
After the charge was over, there was another one that said "Logs"...then... 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.

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
- 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
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.
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
So, uh, CHAdeMO is done.

-Matt
-
- 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
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
- 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
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.

- 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
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
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
- 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
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.
Tomorrow:
ISA Shunt work.
-Matt
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.

Tomorrow:
ISA Shunt work.
-Matt
- 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
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
"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
- 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
Ok, got a quick voltage check in the CHAdeMO charge software, will test it out tomorrow.
-Matt
-Matt
- 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
And we have something:
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
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
- 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
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
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
- 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
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.
Re: Tesla Model 3 Charge Port Controller Standalone Development
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
- 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

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
Re: Tesla Model 3 Charge Port Controller Standalone Development
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:
If any of that's not clear I can make you a video soldering a part just like that
- 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
If any of that's not clear I can make you a video soldering a part just like that
- 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
That's really awesome tips. I'll definitely re-read that if I end up having to re-do this mess. 
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

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
- EV_Builder
- Posts: 1205
- Joined: Tue Apr 28, 2020 3:50 pm
- Location: The Netherlands
- Has thanked: 18 times
- Been thanked: 37 times
- Contact:
Re: Tesla Model 3 Charge Port Controller Standalone Development
Sorry for my laziness, but where does this development stand?
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
- Jack Bauer
- Posts: 3628
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 3 times
- Been thanked: 211 times
- Contact:
Re: Tesla Model 3 Charge Port Controller Standalone Development
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
- EV_Builder
- Posts: 1205
- Joined: Tue Apr 28, 2020 3:50 pm
- Location: The Netherlands
- Has thanked: 18 times
- Been thanked: 37 times
- Contact:
Re: Tesla Model 3 Charge Port Controller Standalone Development
ooeeehh thats increasing the odds of succes balisticly...nice!
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
- Jack Bauer
- Posts: 3628
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 3 times
- Been thanked: 211 times
- Contact:
Re: Tesla Model 3 Charge Port Controller Standalone Development
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:)
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3628
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 3 times
- Been thanked: 211 times
- Contact:
Re: Tesla Model 3 Charge Port Controller Standalone Development
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:)
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:)
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3628
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 3 times
- Been thanked: 211 times
- Contact:
Re: Tesla Model 3 Charge Port Controller Standalone Development
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...
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
-
- Posts: 395
- Joined: Sun Aug 25, 2019 12:39 pm
- Location: Finland
- Has thanked: 55 times
- Been thanked: 14 times
Re: Tesla Model 3 Charge Port Controller Standalone Development
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.