Tesla Model 3 Charge Port Controller Standalone Development

Development and discussion of fast charging systems eg Chademo , CCS etc
tom91
Posts: 1273
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 97 times
Been thanked: 201 times

Re: Tesla Model 3 Charge Port Controller Standalone Development

Post by tom91 »

mdrobnak wrote: Tue Dec 15, 2020 7:37 am I need to put in a PR for the SimpBMS Chevy code as Tom added the Coda stuff a little _too_ quickly and had some copy paste errors. :) Happens to the best of us though.
Wait so the there is an issue with my the canbus messaging for the Coda charger or just the Coda charger selection? I put it in on the request of someone and even believe it has been tested and verified to work.

Great progress on this charge port, if feels like a huge snowball rolling down a hill collecting more and more side projects. :o
Founder Volt Influx https://www.voltinflux.com/
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 »

tom91 wrote: Tue Dec 15, 2020 10:32 am Wait so the there is an issue with my the canbus messaging for the Coda charger or just the Coda charger selection? I put it in on the request of someone and even believe it has been tested and verified to work.
Selection was fixed previously. This is some minor issues that unfortunately affect my testing as I'm trying to use the minimum of 200V. See PR: https://github.com/tomdebree/AmperaBattery/pull/4
tom91 wrote: Tue Dec 15, 2020 10:32 am Great progress on this charge port, if feels like a huge snowball rolling down a hill collecting more and more side projects. :o
Thanks! Yes, once this is at least going, I'll swing back to the ISA integration, and then test full EVSE to charger integration :)

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

Good news so far today is that I've gotten the charger outputting voltage. I initially wasn't getting the right output, but I set the input current too low :D Annoyingly CAN Low was white, which is pretty much opposite from standard.. (de facto standard, but still...)

I now get 200V with a 1A current limit, looking good so far. I'll test the CHAdeMO out after I eat some dinner. Stay tuned!

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

YES, YES YES!!


We have working CHAdeMO!!!
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Tesla Model 3 Charge Port Controller Standalone Development

Post by Isaac96 »

Gorgeous!!!!
So you have more or less complete CHAdeMO functionality. Now we get to ask for CCS, right? :)
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 »

Isaac96 wrote: Wed Dec 16, 2020 5:41 am Gorgeous!!!!
I know, right? :)
Isaac96 wrote: Wed Dec 16, 2020 5:41 am So you have more or less complete CHAdeMO functionality. Now we get to ask for CCS, right? :)
We'll go with "yes". ;)

The details about how much current to ask for and voltage I need to work out, but now that I know it works, I can figure out what's going on at this point.

Once I have a better idea of what's needed there, I can try and apply that to CCS and see where that gets us. It will likely be quite similar.

So, yes, CCS will come. But for a somewhat-quick-and-dirty go, it works. :D

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

Congratulations Matt. These are some major developments:)
I'm going to need a hacksaw
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 »

Excellent work!
‘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 »

So, I've found current control.

Here's a fun bit - the CHAdeMO adapter _ignores_ anything above 125 Amps.

I'm having a heck of a time figuring out how to set the voltage, however.

That's all for now. Tomorrow I hope to find voltage.

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

Re: Tesla Model 3 Charge Port Controller Standalone Development

Post by larsrengersen »

mdrobnak wrote: Thu Dec 17, 2020 5:48 am Here's a fun bit - the CHAdeMO adapter _ignores_ anything above 125 Amps.
-Matt
Congrats! Great job.
What CHAdeMO Protocol is set?
0.9, 1.0 and 1.1 are 125A max
1.2 is 400A (but often you need different hardware/car socket)
See my blogpost on Introducing DC fast charging
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 »

larsrengersen wrote: Thu Dec 17, 2020 9:24 am
mdrobnak wrote: Thu Dec 17, 2020 5:48 am Here's a fun bit - the CHAdeMO adapter _ignores_ anything above 125 Amps.
-Matt
Congrats! Great job.
What CHAdeMO Protocol is set?
0.9, 1.0 and 1.1 are 125A max
1.2 is 400A (but often you need different hardware/car socket)
See my blogpost on Introducing DC fast charging
0.9 is what the adapter uses.

Interestingly, Fast Charge Limits CAN _does_ show 255A when I set it to that, but it looks like the adapter refuses to send a value greater than 125.
I've only seen standard 50kW (technically 62.5kW @ 500V) ever.

Didn't figure out voltage control yet. Definitely a little stumped.

-Matt
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Tesla Model 3 Charge Port Controller Standalone Development

Post by johu »

larsrengersen wrote: Thu Dec 17, 2020 9:24 am 0.9, 1.0 and 1.1 are 125A max
Hmm, I've seen 135A on a 60 kW charger. I've implemented 0.9 in Touran.
Attachments
02 charge.png
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

Odd. From here:
https://assets.vector.com/cms/content/e ... eMO_DC.pdf
chademo_2.PNG
That's where I got the 125A number from, and seems to bear out in the Tesla implementation as well. Also note they don't claim to support more than 50kW anyway through the adapter.

In other news, I'm starting to go back and comment all the data and / or break out into variables. A few things as a result:
1. Getting closer to sending more realistic data
2. Redacted code will be available after I update the script to redact it. :D

-Matt
collin80
Posts: 110
Joined: Sun Aug 30, 2020 3:28 pm
Location: United States, Michigan
Been thanked: 4 times
Contact:

Re: Tesla Model 3 Charge Port Controller Standalone Development

Post by collin80 »

mdrobnak wrote: Sun Dec 20, 2020 12:39 am Odd. From here:
https://assets.vector.com/cms/content/e ... eMO_DC.pdf

chademo_2.PNG

That's where I got the 125A number from, and seems to bear out in the Tesla implementation as well. Also note they don't claim to support more than 50kW anyway through the adapter.
-Matt
It's not so odd when you consider how most engineers figure that standards are just vague suggestions. It would not surprise me in the least to find that some implementations went ahead and supported more than 125A just because they could. The number, after all, could be interpreted as an unsigned 8 bit integer so up to 255A could technically be requested. Sure, you're not supposed to do this but, once again, standards are just suggestions. ;)
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 »

collin80 wrote: Sun Dec 20, 2020 3:42 pm It's not so odd when you consider how most engineers figure that standards are just vague suggestions.
This is definitely the quote of the day. :D :D :D

-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 somehow managed to mess with the LED blink pattern, and now my 2019 ECU blinks like my 2018 ECU. I made a dumb mistake and had it powered on while I unplugged the inlet connector, leaving the door / led and power connected.... No idea how I did that one lol.

So.. SWCAN is wired up for sniffing. Except..I can't do it in Linux. Nothing supports 33.3k, and frankly, it needs to be in silent mode due to the pilot -> SWCAN switch. So, off to Windows we go..and I logged some interesting data. Some things I am *not* transmitting on the HV bus are being generated and put on the SWCAN bus. I probably need to fix that data to make the right things happen.

I'll go over that more tomorrow.

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

Keep up the good work Matt:)
I'm going to need a hacksaw
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 »

Jack Bauer wrote: Mon Dec 21, 2020 9:26 am Keep up the good work Matt:)
Thanks. :) If all goes well I should have more for you to test second week of January. Things need cleaning up. I at least did put in the state transitions like with the CHAdeMO EVSE. In terms of a hack / refine phase, we're definitely in the hack state. :D

So some clarifications... This connector is the one I unplugged and left the power on with:
PXL_20201221_043619382.NIGHT.jpg
The green wire is ground, and the white with purple is pilot. This connects to CAN Low (Ground), and CAN High (Pilot).

This then results in:
PXL_20201221_222127469.NIGHT.jpg
And my table still looks reasonable:
PXL_20201221_221951599.jpg

I did get it to work in Linux using my ValueCAN3. The key is the drivers basically just use the hardware config and can't modify it on the fly. So I booted into Windows, set CAN 1 to 500k and normal mode, and set CAN 2 to 33.3k and silent mode. Now I can capture in SavvyCAN and analyze in Vehicle Spy.

I did not get far with figuring out what causes the Fast Charge limits to be calculated as they are, but I did figure some things out. I think there's about 30 signals, and I figured out about 13 of them, including all the CHAdeMO ones. The others are harder. There's three multiplexed ones that I have no idea what's going on with them. :D

Not sure how much I'll do tomorrow, I'll probably do some stuff in the morning but the afternoon is busy.

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

I know I've been quiet, but I'm really battling figuring out some of this data.

So far what I have for the CHAdeMO current request vs what I have listed as a 'BMS current limit' seem to be two completely different items. I'm also unable to get the voltage to change at the moment. So I'm a bit stuck. However I'm trying to attack this from a few different sides and I think I'll see some more progress soon.
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 »

I have faith in you Matt:)
I'm going to need a hacksaw
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 »

Thanks, Damien. :)

There is an ID on the vehicle bus side (?!?!) that shows BMS limits. I've tried sending that on the CP side, no go. So I tried sending that data on basically every ID I am not sending, no immediately visible changes, however I will look at the SWCAN data tomorrow and see if anything changed as a result of my experiment.

In other news, people are getting their CCS adapter from SETEC...and..it works at Electrify America, but otherwise the success rate seems low for most people. In other words, not great.

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

Well that was a bust.

Found the ID which generates some alerts, and found that 0x604 is repeated as-is from CP CAN to SW CAN. But does not produce a useful change that I can see.

Maybe I need to figure out how to wire up a way to spy on the SWCAN on my car and capture an actual CHAdeMO session.

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

Unfortunately nothing majorly new to report here at the moment with respect to functionality.

Some code cleanup in progress - a 3rd party has put together a driver for the bxCAN peripheral - https://github.com/stm32-rs/bxcan
So I'm attempting to get that working, which hopefully will get us the ability to use interrupts for receive rather than a crazy 1ms or 0.5ms loop :)

After that there has finally been some movement on the RTC driver for the STM32F4 Pull Request, and it apparently needs some fixes, and some testing - I never tested "day of week" and...that probably is somewhat broken.

I've git stashed away the work in progress stuff, so after I switch over this driver I'll probably update the redacted repo. Sorry for the delay on that.

There's been some other breaking changes on the HAL that I need to update some code to get going, but not ready for that quite yet.

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

I was able to re-work the code to use the bxcan driver, however something is definitely not right at the moment. It panics after queueing the first frame to be sent. Nothing shows up on the wire. Yay. But the code structure changes are ready to go. A downside is that the error handling code I added in is...useless again. LOL. Once I get it working I'll talk with the maintainers about their thoughts for future changes.

Next items, no timeline:
* CAN driver update
* RTC driver fix for STM32F4
* Breaking changes HAL update

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

Some good news, I have verified the bxcan driver works in a testing scenario. Test parameters were an 8 MHz clock, with a single ID, 8 bytes long, sending as fast as possible. With a debug build I was seeing about 2000 frames a second. With fully-optimized release build -- 4000!

The downside is that the example code uses a non-blocking method to send, which doesn't quite work with RTIC. However, a nice RTIC example was provided with using a queue and interrupt based send and receive.

Sooo even more code to write, but it's going to be even more efficient when done with this change.

-Matt
Post Reply